--- kind: change title: Create an OAuth authorization for an app created_at: 2012-12-06 author_name: pengwynn --- The [Authorizations API][oauth-api] is an easy way to create an OAuth authorization using Basic Auth. Just POST your desired scopes and optional note and you get a token back:
curl -u pengwynn -d '{"scopes": ["user", "gist"]}' \
https://api.github.com/authorizations
This call creates a token for the authenticating user tied to a special "API"
OAuth application.
We now support creating tokens for _your own OAuth application_ by passing your
twenty character `client_id` and forty character `client_secret` as found in
the settings page for your OAuth application.
curl -u pengwynn -d '{ \
"scopes": ["user", "gist"], \
"client_id": "abcdeabcdeabcdeabcdeabcde" \
"client_secret": "abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde" \
}' \ '
https://api.github.com/authorizations
No more implementing the [web flow][web-flow] just to get a token tied to your
app's rate limit.
[oauth-api]: /v3/oauth/#oauth-authorizations-api
[web-flow]: /v3/oauth/#web-application-flow