googlesamples / google-signin-unity

Google Sign-In API plugin for Unity game engine. Works with Android and iOS.
Other
414 stars 225 forks source link

How to get the Access Token to use with Google services #147

Open AshD opened 4 years ago

AshD commented 4 years ago

Is it possible for Google SignIn return the OAuth Token that can be used for accessing Google services like Classroom, Docs, Sheets API?

I had asked this question on Stackoverflow but no response. https://stackoverflow.com/questions/62058765/firebase-idtoken-to-google-oauth2-access-token-in-unity

Thanks, Ash

mehmetresatdilbaz commented 4 years ago

There is an endpoint for this in googe api.

You should post to "https://oauth2.googleapis.com/token" with parameters { client_id:"", client_secret:"<that client's secret>", code:"", grant_type:"authorization_code", redirect_uri:"", }

then you can get the access_token from that post.