question

James Lennon avatar image
James Lennon asked

Issue with Google ServerAuthCode

I am using UE4 with Playfab and I ended up modifying the engine to return the ServerAuthCode with an updated google play login call. I am using Signed By Google Play in my project so most of my testing has been done with apk's signed with my upload key (which is in my console) in both Debug and Shipping builds. The issue now is that I am able to log in to google play but it doesn't return the authToken during the request in the APK's signed by Google but they work just fine when signed by the upload key.

The sign in request is:

GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN)
				.requestProfile()
				.requestServerAuthCode("PlayFab OAuth Client ID")
				.build();

I know it is signing in to google because my IAP query is showing up (which relies on the UE4 Online Subsystem getting stuff from Google) but my auth token value is returning None. The engine is using Google Play Services 11.8.0 and I have not yet tried to update the version yet but that is on the list.

I have tried both the silent login and not, triple checked all the API key settings, checked the logs as much as possible but in shipping builds it is next to none, and I have tried logging in with a CustomID (which does work and receipt verification does work when playfab is working).

I feel like I am missing something but the way the I understand the flow is Sign In with GPG->Get Auth Token from PlayFab server->Send the Auth Token back to Playfab with the LoginWithGoogle request.

unrealAuthentication
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
James Lennon avatar image
James Lennon answered

After some digging around with adb, the app ID from Build\Android\res\values\GooglePlayAppID.xml was blank (which was odd) and was throwing app not authorized errors. Then it was complaining about requiring user input so I reverted the silent sign-in back to the original way via intent and handling it in the onActivityResult() method and redid all of my console auth-key linking. One of the biggest issues I think was that the upload key SHA-1 was in there twice while the Google Play signing SHA-1 was not.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.