Open Tanek81 opened 7 years ago
Can you share an unfiltered log of attempting to sign in the second time?
Hi Clay, first of all thank you for your support.
By looking again at the unfiltered log, I think I have identified one possible cause of this issue:
08-01 17:03:28.887: W/Auth(7870): [GetToken] GetToken failed with status code: INVALID_AUDIENCE 08-01 17:03:28.888: E/TokenRequestor(7857): You have wrong OAuth2 related configurations, please check. Detailed error: INVALID_AUDIENCE 08-01 17:03:28.900: I/SignInActivity(17503): Transition from 6 to 11 08-01 17:03:28.900: W/SignInActivity(17503): onSignInFailed()... 08-01 17:03:28.900: W/SignInActivity(17503): Sign in failed during 6 08-01 17:03:28.900: W/SignInActivity(17503): ==> Returning non-OK result: 10002
I noticed this because the Web App Client ID I inserted at the beginning of the integration was actually wrong, it is something I already fixed this morning while going on with the plugin integration along with Firebase (it was an easy find as of course I rechecked everything connected to Firebase, including the OAuth2 token). I took a small leap of faith (I was afraid to be again unable to test on my device) and I just tested the reported flow with the updated test app and it seems to work correctly.
So I think this can be reproduced in this way:
Of course I should have inserted the correct Web App Client ID from the beginning but the strange thing is that the login worked without any problem (even starting again the app) unless I did a logout, then everything stopped working. Let me know if I can help further, if needed I can also checkout the exact commit I used yesterday and then change only the Web App Client ID to confirm my thoughts (now that I know that this can be solved I am more willing to retry this flow ;) ).
You are correct - INVALID_AUDIENCE usually indicates a problem with the web client id. Which version of the plugin are you using? There was a version where it logs in twice, once via the C++ SDK which does not know about the webclient id/auth code and one via the TokenClient - which calls the Java SDK via JNI and that one does understand the web client id.
It sounds like from your description that the C++ one finishes first then when you log out, the java one finished first with the failure?
This should be fixed in 0.9.39a.
I am using latest plugin version:
plugin version 0.39.9a (latest)
So whats the status with this!? Ran into same issue today.......
I am using 0.9.40
going through the same nightmare for the last 24hrs.
I am experiencing a strange behaviour while testing this plugin.
Situation: the game is published, the app on the GPG section of my dashboard is ready but not published (I won't publish until my code and all the tests will make my game ready to be deployed in Alpha version), my account is set as a tester, I am testing a build with GPG integration on my tablet (Nvidia Shield Tablet, Android 5.1.1) and on my phone (Nexus 5, Android 6.0.1), Unity 5.6.1, plugin version 0.39.9a (latest). Everything is working fine, I can log in, I see my app and the requested authorizations in my Google account ("App connected to your account"), I can unlock and see test achievements, I can log out, I still have to implement cloud save and leaderboards so those will tested in a later stage.
The strange behaviour happens when I log out (by my custom button or by the GPG provided "log out" in the menu while browsing achievements) and then I try to log in again, I was testing this flow having in mind a possible log out by mistake. After logging out there is no way I can log in again, I tried closing the game and reopening it (I have implemented an automatic login on game opening) and I retried when the game opened by tapping on my custom "log in" button (which of course does the same thing), in both cases the plugin shows the log in flow, then asks me to choose an account, I tap to choose the only account I have and then it does not authenticate me. I have also tried removing the authorization from "App connected to your account" and sometimes this solves the situation after some retries, when it's not solved the login flow does not ask the confirmation for allowing the app to have the requested information (the usual "allow/deny" window), so it stops earlier its flow. That is confirmed also by the fact that the plugin is not calling GPG for authorization as I have no evidence of traffic in the Google Cloud dashboard. As per today I have not found a flow to solve this issue, this means that right now on my device I cannot go on testing because I cannot log in (but please bear in mind that everything is working in a "normal" situation, I have tested it). I don't know if this issue is related only to the testing phase with the GPG app not published, I also searched for similar issues but found nothing (I am sure I am not the only one testing a log out -> log in flow ;) ), right now for me this is quite blocking.
The logs while trying to log in:
Code for logging in and logging out (it's a very simple flow right now, copied from the plugin examples):
Please let me know if you need anything else and thank you.