Skip to content

Commit 63f963f

Browse files
committed
Merge pull request github#684 from github/izuzak-request-scopes-which-are-needed
Create OAuth token with repo and user scope in getting started guide
2 parents 9f14894 + 498e94b commit 63f963f

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

content/guides/getting-started.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ 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
<pre class="terminal">
199-
$ curl -i -u &lt;your_username&gt; -d '{"scopes": ["repo"], "note": "getting-started"}' \
199+
$ curl -i -u &lt;your_username&gt; -d '{"scopes": ["repo", "user"], "note": "getting-started"}' \
200200
https://api.github.com/authorizations
201201

202202
HTTP/1.1 201 Created
@@ -205,7 +205,8 @@ Content-Length: 384
205205

206206
{
207207
"scopes": [
208-
"repo"
208+
"repo",
209+
"user"
209210
],
210211
"token": "5199831f4dd3b79e7c5b7e0ebe75d67aa66e79d4",
211212
"updated_at": "2012-11-14T14:04:24Z",
@@ -230,7 +231,9 @@ Next, let's look at the `scopes` we're sending over in this call. When creating
230231
a new token, we include an optional array of [_scopes_][scopes], or access
231232
levels, that indicate what information this token can access. In this case,
232233
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
234+
write to public and private repositories, and _user_ scope, which grants read
235+
and write access to public and private user profile data. See
236+
[the scopes docs][scopes] for a full list of
234237
scopes. You should **only** request scopes that your application actually needs,
235238
in order to not frighten users with potentially invasive actions. The `201`
236239
status code tells us that the call was successful, and the JSON returned
@@ -243,7 +246,7 @@ in the [X-GitHub-OTP request header][2fa header]:
243246

244247
<pre class="terminal">
245248
$ curl -i -u &lt;your_username&gt; -H "X-GitHub-OTP: &lt;your_2fa_OTP_code&gt;" \
246-
-d '{"scopes": ["repo"], "note": "getting-started"}' \
249+
-d '{"scopes": ["repo", "user"], "note": "getting-started"}' \
247250
https://api.github.com/authorizations
248251
</pre>
249252

0 commit comments

Comments
 (0)