Announcement

Collapse
No announcement yet.

[SOLVED] OnlineSubsystemGoogle - BAD_AUTHENTICATION

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] OnlineSubsystemGoogle - BAD_AUTHENTICATION

    Hi there,

    I'm trying to hook up the "Show External Login UI" to show a Google OAuth logiin for the the user.

    I have done the following:
    Setup an app within Google Play Store dev console: https://play.google.com/apps/publish
    The same OAuth 2.0 Client ID listed is the same one below.

    In https://console.developers.google.com/apis/credentials:
    - Created an Android client (for the ClientID) (same as the App Client ID above)
    - Created a Web App (for the ClientSecret & ServerClientID)

    From https://play.google.com/apps/publish/:
    Exported the Certificate under the App Signing section and dropped it into Build/Android/ folder.

    I keep receiving BAD_AUTHENTICATION in the logs (via logcat on my Android device)

    Here is a snippet:
    Code:
    04-22 01:04:57.254  4699  4790 D UE4     : LogOnline: OSS: Creating online subsystem instance for: Google
    04-22 01:04:57.254  4699  4790 D UE4     : GetConfigurationDelegate was not bound!
    04-22 01:04:57.254  4699  4790 D UE4     : LogOnlineIdentity: Display: Google: FOnlineIdentityGoogle::FOnlineIdentityGoogle()
    04-22 01:04:57.254  4699  4790 D UE4     : AndroidThunkCpp_Google_Init ANDROID_CLIENT_ID_REMOVED.apps.googleusercontent.com WEBAP_CLIENT_ID_REMOVED.apps.googleusercontent.com
    04-22 01:04:57.254  4699  4790 D UE4     : [GameActivity] [JAVA] - AndroidThunkJava_Google_Init begin:
    04-22 01:04:57.254  4699  4790 D UE4     : [GameActivity] [JAVA] - clientId:ANDROID_CLIENT_ID_REMOVED.apps.googleusercontent.com
    04-22 01:04:57.254  4699  4790 D UE4     : [GameActivity] [JAVA] - serverId:WEBAP_CLIENT_ID_REMOVED.apps.googleusercontent.com
    04-22 01:04:57.254  4699  4790 D UE4     : [GOOGLE] init
    04-22 01:04:57.266  4699  4790 D UE4     : [GOOGLE] isGooglePlayServicesAvailable statusCode: 0
    04-22 01:04:57.266  4699  4790 D UE4     : [GOOGLE] Is Google Play Services Available:true
    04-22 01:04:57.266  4699  4790 D UE4     : [GOOGLE] packageName: com.deeplionstudios.game
    04-22 01:04:57.266  4699  4790 D UE4     : [GOOGLE] GoogleSignIn clientId:ANDROID_CLIENT_ID_REMOVED.apps.googleusercontent.com
    04-22 01:04:57.266  4699  4790 D UE4     : [GOOGLE] GoogleSignIn serverClientId:WEBAP_CLIENT_ID_REMOVED.apps.googleusercontent.com
    04-22 01:04:57.271  4699  4790 D UE4     : [GOOGLE] EncryptedStringHere
    04-22 01:04:57.271  4699  4790 D UE4     : [GOOGLE] init complete: true
    04-22 01:04:57.271  4699  4790 D UE4     : [GameActivity] [JAVA] - Google SDK success!
    04-22 01:04:57.271  4699  4790 D UE4     : [GameActivity] [JAVA] - AndroidThunkJava_Google_Init end: 0
    04-22 01:04:57.271  4699  4790 D UE4     : AndroidThunkJava_Google_Init retval=0
    04-22 01:04:57.271  4699  4790 D UE4     : LogOnline: OSS: TryLoadSubsystemAndSetDefault: Loaded subsystem for module [Google]
    04-22 01:04:57.271  4699  4790 D UE4     : LogOnline: Display: OSS: OnlineSubsystemGooglePlayModule::StartupModule()
    04-22 01:04:57.271  4699  4790 D UE4     : LogOnline: OSS: Creating online subsystem instance for: GooglePlay
    04-22 01:04:57.271  4699  4790 D UE4     : FOnlineSubsystemGooglePlay::Init
    04-22 01:04:57.272  4699  4790 D UE4     : LogOnlineIdentity: Display: OSS: FOnlineIdentityGooglePlay::FOnlineIdentityGooglePlay()
    04-22 01:04:57.272  4699  4790 D UE4     : FOnlineSubsystemGooglePlay::IsInAppPurchasingEnabled 0
    04-22 00:51:50.923  4395  7092 E Auth    : [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. Account: <ELLIDED:1461386651>, App: com.android.vending, Service: oauth2:https://www.googleapis.com/auth/googleplay
    04-22 00:51:50.923  4395  7092 E Auth    : sgx: Long live credential not available.
    04-22 00:51:50.923  4395  7092 E Auth    :      at hdb.a(:com.google.android.gms@19829019@19.8.29 (040400-282600551):156)
    04-22 00:51:50.923  4395  7092 E Auth    :      at gzi.a(:com.google.android.gms@19829019@19.8.29 (040400-282600551):42)
    04-22 00:51:50.923  4395  7092 E Auth    :      at gzi.a(:com.google.android.gms@19829019@19.8.29 (040400-282600551):150)
    04-22 00:51:50.923  4395  7092 E Auth    :      at hbr.getAuthToken(:com.google.android.gms@19829019@19.8.29 (040400-282600551):22)
    04-22 00:51:50.923  4395  7092 E Auth    :      at android.accounts.AbstractAccountAuthenticator$Transport.getAuthToken(AbstractAccountAuthenticator.java:244)
    04-22 00:51:50.923  4395  7092 E Auth    :      at android.accounts.IAccountAuthenticator$Stub.onTransact(IAccountAuthenticator.java:113)
    04-22 00:51:50.923  4395  7092 E Auth    :      at android.os.Binder.transact(Binder.java:507)
    04-22 00:51:50.923  4395  7092 E Auth    :      at dwe.onTransact(:com.google.android.gms@19829019@19.8.29 (040400-282600551):2)
    04-22 00:51:50.923  4395  7092 E Auth    :      at android.os.Binder.transact(Binder.java:507)
    04-22 00:51:50.923  4395  7092 E Auth    :      at aawd.onTransact(:com.google.android.gms@19829019@19.8.29 (040400-282600551):29)
    04-22 00:51:50.923  4395  7092 E Auth    :      at android.os.Binder.execTransact(Binder.java:573)
    04-22 00:51:50.924  4395  7092 W Auth    : [GetToken] GetToken failed with status code: BadAuthentication
    04-22 00:51:50.961  4395  7092 W GLSActivity: com.google.android.gms.auth.UserRecoverableAuthException: BadAuthentication
    04-22 00:51:50.961  4395  7092 W GLSActivity:   at hbr.getAuthToken(:com.google.android.gms@19829019@19.8.29 (040400-282600551):18)
    04-22 00:51:50.961  4395  7092 W GLSActivity:   at android.accounts.AbstractAccountAuthenticator$Transport.getAuthToken(AbstractAccountAuthenticator.java:244)
    04-22 00:51:50.961  4395  7092 W GLSActivity:   at android.accounts.IAccountAuthenticator$Stub.onTransact(IAccountAuthenticator.java:113)
    04-22 00:51:50.961  4395  7092 W GLSActivity:   at android.os.Binder.transact(Binder.java:507)
    04-22 00:51:50.961  4395  7092 W GLSActivity:   at dwe.onTransact(:com.google.android.gms@19829019@19.8.29 (040400-282600551):2)
    04-22 00:51:50.961  4395  7092 W GLSActivity:   at android.os.Binder.transact(Binder.java:507)
    04-22 00:51:50.961  4395  7092 W GLSActivity:   at aawd.onTransact(:com.google.android.gms@19829019@19.8.29 (040400-282600551):29)
    04-22 00:51:50.961  4395  7092 W GLSActivity:   at android.os.Binder.execTransact(Binder.java:573)
    In my AndroidEngine.ini:
    Code:
    [OnlineSubsystem]
    DefaultPlatformService=Google
    
    [OnlineSubsystemGoogle]
    bEnabled=true
    ClientId="ANDROID_CLIENT_ID.apps.googleusercontent.com"
    ServerClientId="WEB_CLIENT_ID.apps.googleusercontent.com"
    ClientSecret="WEB_CLIENT_SECRET"
    
    [OnlineSubsystemGoogle.OnlineIdentityGoogle]
    +ScopeFields="https://www.googleapis.com/auth/userinfo.email"
    +ScopeFields="https://www.googleapis.com/auth/userinfo.profile"
    In my DefaultEngine.ini
    Code:
    [/Script/AndroidRuntimeSettings.AndroidRuntimeSettings]
    PackageName=com.nameof.game
    GamesAppID=APPID_FROM_PLAYSTORE_CONSOLE
    GooglePlayLicenseKey=SECRET_FROM_PLAYSTORE_CONSOLE
    I have tried reversing the ID's, using other generated ID's from the API console, but no success. Any help would be greatly appreciated.

    Cheers
    Last edited by s1mb4; 04-23-2020, 11:21 AM.

    #2
    Turns out my password for my keystore was off by one character. The BAD_AUTH can mean you're signing your app with a key that google does not have registered or your keystore signing is incorrect.

    Leaving this here in case anyone else has similar issues.
    Last edited by s1mb4; 04-24-2020, 10:01 AM.

    Comment

    Working...
    X