Access OAuth provider specific information #220
-
I'd like to specify GitHub scopes to retrieve more information about a user, and in particular |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
This looks useful: https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-the-authenticated-user |
Beta Was this translation helpful? Give feedback.
-
Regarding the scopes, Fief will always by default ask for the scope Now, as to how to call the GitHub API. What you show here won't work because you try to use the Fief access token on GitHub, which doesn't recognize it. However, Fief provides an Admin API so you can generate fresh access tokens from the connected OAuth Provider. You can read more about it here: https://docs.fief.dev/going-further/oauth-provider-token/ So basically:
|
Beta Was this translation helpful? Give feedback.
Regarding the scopes, Fief will always by default ask for the scope
user
anduser:email
with GitHub. So you should already be covered to callhttps://api.github.com/user
. Apparently, there is no specific permission to enable on the GitHub app settings, apart from "Email addresses" -> "Read-only".Now, as to how to call the GitHub API. What you show here won't work because you try to use the Fief access token on GitHub, which doesn't recognize it.
However, Fief provides an Admin API so you can generate fresh access tokens from the connected OAuth Provider. You can read more about it here: https://docs.fief.dev/going-further/oauth-provider-token/
So basically: