My application uses Github’s Oauth.
Suppose that:
- in version 1, the app required only basic authorization (scopes = [])
- in version 2, the app required R/W access to public repos (scope = [‘public_repo’])
Some users have not logged in yet since the upgrade.
Now I have some tokens with greater authorization capabilities then others. How do I tell them apart?
In other words, how can I ask Github: “Hey, I have this oauth token… what can I do with it?”
You can make any GitHub API request and read the value of the X-OAuth-Scopes header to see which scopes were supplied with the token. Using /rate_limit won’t count against your app’s rate limit.