playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.43k stars 953 forks source link

JWT Access Token #3257

Open DanilChizhikov opened 1 year ago

DanilChizhikov commented 1 year ago

Hello, i want get jwt access token with your sdk, but i can not found where i do it.

hippogamesunity commented 4 months ago

Hello! I also can't get JWT with the latest asset version. Yes, there is PlayGamesPlatform.Instance.RequestServerSideAccess which will return you an auth code (that can be exhanged for an access token). But with currect access scopes the token response doesn't contain id_token (JWT) tokenResponse={ "access_token": "...", "expires_in": 3599, "scope": "https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/games_lite", "token_type": "Bearer" }

Google says "This property is only returned if your request included an identity scope, such as openid, profile, or email." (https://developers.google.com/identity/protocols/oauth2/native-app#exchange-authorization-code).

So the main question is how to add extra scopes for RequestServerSideAccess? @claywilkinson

hippogamesunity commented 4 months ago

As I see, it's impossible to edit plugin C# code, evertthing is hidden inside JAR image

hippogamesunity commented 4 months ago

https://developers.google.com/games/services/android/signin#remove_extra_scopes sh*t

hippogamesunity commented 4 months ago

While "Google Sign-In for Android is outdated and no longer supported." https://developers.google.com/identity/sign-in/android/start-integrating

eturpin commented 4 months ago

While "Google Sign-In for Android is outdated and no longer supported." https://developers.google.com/identity/sign-in/android/start-integrating

Have you found an alternative solution/plugin? I'd rather not keep using the old 10.14 version for fear of whatever method it uses will be deprecated. The only reason I'm using this plugin is for 1-click sign-in and to get an auth code to issue my own JWT token.

hippogamesunity commented 4 months ago

Simple Google Sign-In from the Asset Store