Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit2c8ec14

Browse files
committed
Fix confusing about missing "plan" field of user data due to missing "user" scope
Readers may confuse when they create OAuth token following the examplecurl command instead on the web form and noticed that the "plan" userdata field not displayed even when they're authenticated successfullydue to the missing "user" scope access.This commit fixes this issue by also request "repo", "public_repo","user", and "gist" scope in the Oauth token command-line request casesthus the result will be same with the one using GitHub's webform.This change may needs further lingual and cosmetic patches to make itwell-looking enough.Signed-off-by: V字龍(Vdragon) <Vdragon.Taiwan@gmail.com>
1 parentc482b7e commit2c8ec14

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

‎content/guides/getting-started.md‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,19 @@ Also, the [**Authorizations API**][authorizations api] makes it simple to use Ba
196196
to create an OAuth token. Try pasting and running the following command:
197197

198198
<preclass="terminal">
199-
$ curl -i -u&lt;your_username&gt; -d '{"scopes": ["repo"], "note": "getting-started"}' \
200-
https://api.github.com/authorizations
199+
$ curl -i -u&lt;your_username&gt; -d '{"scopes": ["repo", "public_repo", "user", "gist"], \
200+
"note": "getting-started"}' https://api.github.com/authorizations
201201

202202
HTTP/1.1 201 Created
203203
Location: https://api.github.com/authorizations/2
204204
Content-Length: 384
205205

206206
{
207207
"scopes": [
208-
"repo"
208+
"repo",
209+
"public_repo",
210+
"user",
211+
"gist"
209212
],
210213
"token": "5199831f4dd3b79e7c5b7e0ebe75d67aa66e79d4",
211214
"updated_at": "2012-11-14T14:04:24Z",
@@ -230,7 +233,9 @@ Next, let's look at the `scopes` we're sending over in this call. When creating
230233
a new token, we include an optional array of[_scopes_][scopes], or access
231234
levels, that indicate what information this token can access. In this case,
232235
we're setting up the token with_repo_ access, which grants access to read and
233-
write to private repositories. See[the scopes docs][scopes] for a full list of
236+
write to private repositories,_public\_repo_ grants access to read and write to
237+
public repositories,_user_ grants access to read and write to all user data, and
238+
_gist_ grants access to create new gists. See[the scopes docs][scopes] for a full list of
234239
scopes. You should**only** request scopes that your application actually needs,
235240
in order to not frighten users with potentially invasive actions. The`201`
236241
status code tells us that the call was successful, and the JSON returned
@@ -243,8 +248,8 @@ in the [X-GitHub-OTP request header][2fa header]:
243248

244249
<preclass="terminal">
245250
$ curl -i -u&lt;your_username&gt; -H "X-GitHub-OTP:&lt;your_2fa_OTP_code&gt;" \
246-
-d '{"scopes": ["repo"], "note": "getting-started"}' \
247-
https://api.github.com/authorizations
251+
-d '{"scopes": ["repo", "public_repo", "user", "gist"], \
252+
"note": "getting-started"}'https://api.github.com/authorizations
248253
</pre>
249254

250255
If you enabled 2FA with a mobile application, go ahead and get an OTP code from

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp