Skip to main content

Google Play Games as an identity provider

Last updated on August 5, 2026

Overview

This guide helps developers connect Google Play Games accounts to AccelByte Gaming Services (AGS). Google Play Games is separate from Google sign-in — it is specifically for Android games using the Google Play Games Services SDK. For standard Google sign-in, see Set up Google as an identity provider. Depending on your game, you may need to set up additional features within Google Play services that we haven't listed here. For more information about setting up Google Play services, we recommend contacting your Google representative and reviewing the Google Play documentation directly.

important

This guide is intended for public use and contains limited information due to confidentiality. We recommend you refer to the full confidential guide first. To request a copy of the confidential guide, contact your AccelByte Technical Producer.

Goals

To enable the Google Play authentication method for your game with the AGS SDK.

Prerequisites

Set up Google Play

Create a Google Android app

Create a Google App. Follow the Create and set up your app guide.

Build your blank Unreal project in Android App Bundle (AAB) format with a designated keystore. For more details about generating a keystore for your Unreal project, read Unreal's article on Signing Projects for Release.

Create a release for your project

Create a release for your app. Follow the Prepare and roll out a release guide.

Set up Google Play Games Services

Setting up your Google Play Games Services. Follow the Set Up Google Play Games Services guide. You will need to:

  • Create a Play Games Services project.
  • Create an OAuth consent screen in the Google Cloud Platform. On the OAuth consent screen, add these four scopes to your app:
    • openid
    • .../auth/games
    • .../auth/games_lite
    • .../auth/drive.appdata
  • Create Android and Game Server credentials.

After you're done setting it all up, review and publish.

Set up the Google Play Games login provider in AGS

Use the following steps to set up Google Play Games login for your game. This will allow your players to sign in to the game using their Google Play Games accounts.

  1. In the AGS Admin Portal, go to your game namespace.

  2. On the sidebar menu, go to Foundations > 3rd Party Integrations > Auth & Account Linking.

    Add new login method button

  3. On the Auth & Account Linking page, click + Add New.

  4. On the Select login provider page, find Google Play Games under the Gaming Platform tab and click on it.

    Image shows the Google Play Games platform option

  5. The Set up Google Play Games login provider form appears.

    Image shows the Configuration form

  6. Fill in the following fields:

    • Platform ID: googleplaygames. Set automatically. Cannot be changed.
    • Client ID: Your OAuth Client ID from Google Cloud Console.
    • Client secret: Your OAuth Client Secret from Google Cloud Console.
    • Redirect URI: The OAuth callback URL. Prefilled with http://127.0.0.1.
  7. Click Add & Activate to create and activate the provider in one step. Alternatively, click Add to create without activating.

    Activate confirmation message

Edit a login provider

  1. On the Auth & Account Linking page, click the Google Play Games entry.

  2. A dialog appears with the provider's configuration. Update the fields as needed.

  3. Use the Status toggle at the top to activate or deactivate the provider.

  4. Click Save.

Create an IAM client

An IAM client is a representation of the game client that you want to release on your target platform. Learn more about IAM Clients in Manage access control for applications.

In-game login instructions

By following this documentation, you can integrate your game sign-in process using the AGS SDK so your players can log in to games using their Google Play Accounts. For a player to log in to your game or platform with Google credentials, the game needs to pass the Auth token from the Google platform that has the credentials the player is using to the publisher platform.

The setup for each game engine is different. Choose your game engine from the available tabs.

In-game login integration (Unreal)

Create Unreal Engine Project

After creating a new Unreal Engine project you will need to set and configure several things inside your project.

Enable OnlineSubsystemGoogle Plugins and Service Configurations

  1. Enable Plugins on .uproject file.
{
"Plugins": [
{
"Name": "AccelByteUe4Sdk",
"Enabled": true
},
{
"Name": "OnlineSubsystemAccelByte",
"Enabled": true
},
{
"Name": "OnlineSubsystemGooglePlay",
"Enabled": true
},
{
"Name": "OnlineSubsystemGoogle",
"Enabled": true
}
]
}
  1. Inside DefaultEngine.ini, set and add the credentials from the Google Cloud platform.
[OnlineSubsystem]
DefaultPlatformService=GooglePlay
NativePlatformService=Google

[OnlineSubsystemGoogle]
bEnabled=True
ClientId=123456789-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com
ServerClientId=123456789-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com
ClientSecret=abcdefghijklmnopqrstuvwxyz123456789

[OnlineSubsystemGoogle.OnlineIdentityGoogle]
+ScopeFields="email"
+ScopeFields="profile"
+ScopeFields="https://www.googleapis.com/auth/userinfo.email"
+ScopeFields="https://www.googleapis.com/auth/userinfo.profile"

[OnlineSubsystemGooglePlay]
bEnabled=True

[OnlineSubsystemGooglePlay.Store]
bSupportsInAppPurchasing=True
bUseStoreV2=False

[/Script/AccelByteUe4Sdk.AccelByteSettings]
ClientId=abcdefg12345
ClientSecret=abcdefg12345
Namespace=test
PublisherNamespace=accelbyte
BaseUrl="https://prod.gamingservices.accelbyte.io"
QosPingTimeout=0.6
  1. Add the following code to your <PROJECT>.Build.cs file.

      if (Target.Platform == UnrealTargetPlatform.Android)
    {
    PrivateDependencyModuleNames.AddRange(new string[]
    {
    "OnlineSubsystemGoogle",
    "OnlineSubsystemGooglePlay",
    });
    }
  2. In Platforms - Android, match the package name defined in this project setting and on the Google console.

  3. In Platforms - Android Distribution Setting, configure the distribution signing. For more information, refer to Signing Projects for Release.

  4. In Platforms - Android - Google Play Service, obtain the Games App ID and Google Play License Key from the Google Play Console.

    • Games App ID is located at Play Games Services > Configuration
    • Google Play License Key is located at Monetize > Monetization Setup > Licensing
  5. In Platforms - Android SDK, configure the fields based on your engine version. For more information, see Unreal Engine Version History.

Google Play Native Login and AGS Access implementation

  1. Initialize the necessary subsystems and interfaces.
const IOnlineSubsystem* OnlineSubsystemNativePtr = IOnlineSubsystem::GetByPlatform();
const IOnlineIdentityPtr OnlineIdentityNativePtr = OnlineSubsystemNativePtr->GetIdentityInterface();
const IOnlineExternalUIPtr NativeExternalUI = OnlineSubsystemNativePtr->GetExternalUIInterface();
  1. Implement the login UI for login with Google Play.
FDelegateHandle NativeOnLoginCompleteDelegateHandle;
const FOnLoginCompleteDelegate NativeLoginComplete = FOnLoginCompleteDelegate::CreateLambda(
[&](int32 LoggedInLocalUserNum, bool bWasSuccessful, const FUniqueNetId& UserId, FString Error)
{
// Put your next implementation here.

OnlineIdentityNativePtr->ClearOnLoginCompleteDelegate_Handle(0, NativeOnLoginCompleteDelegateHandle);
});
NativeOnLoginCompleteDelegateHandle = OnlineIdentityNativePtr->AddOnLoginCompleteDelegate_Handle(0, NativeLoginComplete);

NativeExternalUI->ShowLoginUI(0
, true
, false
, FOnLoginUIClosedDelegate::CreateLambda([this, &OnlineIdentityNativePtr, &NativeOnLoginCompleteDelegateHandle, &Result, &bNativeLoginSuccess](FUniqueNetIdPtr UniqueId, const int ControllerIndex, const FOnlineError& Error)
{
// Put your next implementation here.
}));
  1. Get the Auth ID Token once the user has finished the Google Play login.
FString GooglePlayToken = TEXT("");
if (!NativeUserAccountPtr->GetAuthAttribute(AUTH_ATTR_ID_TOKEN, GooglePlayToken))
{
// Do something when Google Play failed to retrieve the Auth Id Token
}
  1. To complete the implementation, log in to AGS with the token that you obtained earlier.
const IOnlineIdentityPtr OnlineIdentityABPtr = OnlineSubsystemABPtr->GetIdentityInterface();

FDelegateHandle ABOnLoginCompleteDelegateHandle;
{
const FOnLoginCompleteDelegate ABLoginComplete = FOnLoginCompleteDelegate::CreateLambda(
[&](int32 LoggedInLocalUserNum, bool bWasSuccessful, const FUniqueNetId& UserId, FString Error)
{
// Put your next implementation here.
OnlineIdentityABPtr->ClearOnLoginCompleteDelegate_Handle(0, ABOnLoginCompleteDelegateHandle);
});
ABOnLoginCompleteDelegateHandle = OnlineIdentityABPtr->AddOnLoginCompleteDelegate_Handle(0, ABLoginComplete);
}

FOnlineAccelByteAccountCredentials OnlineAccountCredentialsNative(
EAccelByteLoginType::GooglePlayGames,
"",
GooglePlayToken,
true);

OnlineIdentityABPtr->Login(0, OnlineAccountCredentialsNative);