#[SOLVED] How to get Data from OAuth2 Providers?

1 messages · Page 1 of 1 (latest)

eternal heath
#

After Github OAuth successful I wanted to retreive the Github userID, searched the web could not find much related to appwrite

Found this for Firebase
https://stackoverflow.com/questions/49108767/github-oauth-provider-get-username-or-id

Does something like this exists for Appwrite also ?

fluid bane
#

How to get Data from OAuth2 Providers?

eternal heath
#

Alright thanks looking into it

eternal heath
#

Hey @fluid bane I tried looking into github docs and reading them for its API's but I cannot find a way to get the username using an OAuth app there , there is authentication using OAuth but I believe we do not want that ig and cannot find the right end point for it

#

could you please help

fluid bane
#

so...did you look in the Session object?

eternal heath
#

Yes I do understand that I get the OAuth access token from the session but where to make the request after getting the access token

eternal heath
# fluid bane so...did you look in the Session object?

not as of now gotta test it, trying to figure out which GitHub API end point would fetch me the users'ID with the access token provided by appwrite please do help me in this I am not able to figure the endpoint out

eternal heath
#

yep the provider access token is there

#

would user id do the thing?

fluid bane
eternal heath
#

yes i just did I understand

#

so I have the provider access token now

#

and I want to get the github username using it

#

could you please guide me with the end point to which I would have to make the request to get it with the access token as the Authentication header

fluid bane
eternal heath
#

yes

fluid bane
eternal heath
#

it is the Uid of the provider

#

I gues

fluid bane
eternal heath
#

I tried it out

#

in implementation initially i thought it might give me what i wanted but it returned a number

#

is it related to my github account ?

fluid bane
eternal heath
#

could this somehow fetch me my username

fluid bane
eternal heath
#

how

fluid bane
eternal heath
#

found this I guess this might help and would pass the auth token as the access token

#

though the appwrite part is resolved thanks a lot

#

Hey @fluid bane made it work thanks a lot

#

its working and I am getting the desired data