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

How can I get the Authorization code?

Open tschuliiia opened this issue 6 years ago • 3 comments
trafficstars

Hello!

I am able to sign in and get the ID token. The thing is I need the access token and refresh token to connect to another api, but therefor i need the authorization code for the request. How can I get that one with your script?

Thanks, Julia

tschuliiia avatar Nov 22 '18 10:11 tschuliiia

Hi, I read the docs and found this which also requires server-side code to get an access token (and refresh token). Is that what you need?

If yes, you would also have to provide a serverClientId, as mentioned here

I can try to add this if it's what you need.

loukaspd avatar Nov 23 '18 12:11 loukaspd

yes, this is what i need. I'm trying to get Google Poly on Android running and for private assets I need Oauth to have access to them and the Poly API just implements Oauth for Desktop, but not for Android. I am playing around by myself to get this working.

tschuliiia avatar Nov 24 '18 13:11 tschuliiia

I have pushed a new branch but I haven't tested it. You can try it, you will have to call the method SignInWithServerClientId and pass the serverClientId, then in you success callback you should get an object that contains public string ServerAuthCode. Let me know if that works.

loukaspd avatar Nov 26 '18 20:11 loukaspd