Skip to content

Commit 6ebc18c

Browse files
committed
Changes post for Authorizations API
1 parent 8d1db91 commit 6ebc18c

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
kind: change
3+
title: Create an OAuth authorization for an app
4+
created_at: 2012-12-06
5+
author_name: pengwynn
6+
---
7+
8+
The [Authorizations API][oauth-api] is an easy way to create an OAuth
9+
authorization using Basic Auth. Just POST your desired scopes and optional
10+
note and you get a token back:
11+
12+
<pre class='terminal'>
13+
curl -u pengwynn -d '{"scopes": ["user", "gist"]}' \
14+
https://api.github.com/authorizations
15+
</pre>
16+
17+
This call creates a token for the authenticating user tied to a special "API"
18+
OAuth application.
19+
20+
We now support creating tokens for _your own OAuth application_ by passing your
21+
twenty character `client_id` and forty character `client_secret` as found in
22+
the settings page for your OAuth application.
23+
24+
25+
<pre class='terminal'>
26+
curl -u pengwynn -d '{ \
27+
"scopes": ["user", "gist"], \
28+
"client_id": "abcdeabcdeabcdeabcdeabcde" \
29+
"client_secret": "abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde" \
30+
}' \ '
31+
https://api.github.com/authorizations
32+
</pre>
33+
34+
No more implementing the [web flow][web-flow] just to get a token tied to your
35+
app's rate limit.
36+
37+
[oauth-api]: /v3/oauth/#oauth-authorizations-api
38+
[web-flow]: /v3/oauth/#web-application-flow

0 commit comments

Comments
 (0)