# \[SOLVED\] OnlineSubsystemGoogle - BAD\_AUTHENTICATION

**URL:** <https://forums.unrealengine.com/t/solved-onlinesubsystemgoogle-bad_authentication/141991>\
**Category:** Mobile\
**Tags:** unreal-engine, Android\
**Created:** [April 22, 2020, 1:51pm UTC](https://forums.unrealengine.com/t/solved-onlinesubsystemgoogle-bad_authentication/141991 "2020-04-22T13:51:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![s1mb4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@s1mb4](https://forums.unrealengine.com/u/s1mb4)\
**Post date:** [April 22, 2020, 1:51pm UTC](https://forums.unrealengine.com/t/solved-onlinesubsystemgoogle-bad_authentication/141991/1 "2020-04-22T13:51:01Z")

</div>

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: [Redirecting...](https://play.google.com/apps/publish)  
The same OAuth 2.0 Client ID listed is the same one below.

In [Google Cloud Platform](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/:](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:

```auto

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:

```auto

[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

```auto

[/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

---

<div class="post-metadata">

**Author:** ![s1mb4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@s1mb4](https://forums.unrealengine.com/u/s1mb4)\
**Post date:** [April 24, 2020, 1:49pm UTC](https://forums.unrealengine.com/t/solved-onlinesubsystemgoogle-bad_authentication/141991/2 "2020-04-24T13:49:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_780d7aa9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_780d7aa9](https://forums.unrealengine.com/u/anonymous_user_780d7aa9)\
**Post date:** [September 27, 2021, 12:23am UTC](https://forums.unrealengine.com/t/solved-onlinesubsystemgoogle-bad_authentication/141991/3 "2021-09-27T00:23:36Z")

</div>

> PackagingResults: Error: Missing precompiled manifest for ‘OnlineSubsystemGoogle’. This module was most likely not flagged for being included in a precompiled build - set ‘PrecompileForTargets = PrecompileTargetsType.Any;’ in OnlineSubsystemGoogle.build.cs to override.  
> PackagingResults: Error: Unknown Error

I built on Android with the same settings as you, but the above error occurred.  
The above error occurs because “OnlineSubsystemGoogle” is a plugin that can only be used on Windows? Please help me!

Additionally, there is a problem that the external UI is not exposed because LoginUrl is empty when ShowLoginUI is called from the Windows. Do I need to configure this part separately?
