How to get data from OAuth Providers? #5053
🔖 Feature descriptionThere is not much information of the OAuth transaction left in the 🎤 PitchThere is many reasons to expose that data to the browser, for ease of integration with other platforms. Please correct me if there already is a way. 👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
|
Replies: 4 comments
|
@zdanl thanks for creating this issue! 🙏🏼 It would be great if this could be split into 3 separate issues so they can be discussed and upvoted accordingly. |
I have a strong feeling it's gonna be ignored, no matter how much effort I put in. Does account.createOAuth2Session() https://appwrite.io/docs/client/account?sdk=web-default#accountCreateOAuth2Session currently have a return object with api key or data from selected scopes? If not, is there any advise on the patch beyond -D |
|
@zdanl yes, it is possible to fetch data from the OAuth provider, assuming adequate scopes were requested. Currently, OAuth data is in the |
@zdanl yes, it is possible to fetch data from the OAuth provider, assuming adequate scopes were requested. Currently, OAuth data is in the
Sessionrather thanAccount. As such, instead of callingaccount.get(), you would callaccount.getSession('current')to get the currentSession. Assuming the session is an OAuth session,providerAccessTokenwould be populated with the access token from the OAuth provider. You can, then, use that access token to make API calls to the OAuth2 provider.