google-signin-unity icon indicating copy to clipboard operation
google-signin-unity copied to clipboard

How to get the Access Token to use with Google services

Open AshD opened this issue 5 years ago • 2 comments

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

AshD avatar Jun 08 '20 18:06 AshD

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:"<auth_code from the google sign in return data>", grant_type:"authorization_code", redirect_uri:"", }

then you can get the access_token from that post.

mehmetresatdilbaz avatar Jul 19 '20 14:07 mehmetresatdilbaz