Platform authentication

To integrate your game with Google Play Games Services, first implement platform authentication. This is required to access all other features, such as achievements, leaderboards, and events.

To meet the Google Play Games Level Up user experience guidelines, your game needs to be compliant with the recommended authentication flow.

Initialization and authentication

This is a required step to initialize and authenticate your game:

  • Implement platform authentication by initializing the Play Games Services v2 SDK on startup. For more information, see platform authentication for Android games. This is a required step for accessing Play Games Services features like achievements and leaderboards.
  • Authentication runs as a silent background process during game launch.
  • Existing Play Games Services users will see a welcome message upon successful authentication.

    Automatic sign-in prompt

Profile creation

Players need a Play Games Services profile to engage with the platform. Some players might not have a Play Games Services profile when they start your game. These players will be asked to create one.

Auto-triggered profile creation prompts appear automatically by default when you launch a game without a Play Games Services profile.

Profile creation prompt when you launch a game.
Profile creation prompt when you launch a game (click to enlarge).

Recommended authentication flow

To meet the Google Play Games Level Up user experience guidelines, verify that you are compliant with the player continuity requirements. In order to successfully sign players into your game, use the following authentication flow:

  1. During the startup sequence of your game, implement the auto-triggered profile creation.
  2. If automatic authentication fails or you decline, show a manual sign-in button so you can authenticate later.

Player ID

A player ID is an identifier for a Play Games Services player account. Your game can retrieve a player ID for any player that signs into your game using Play Games Services authentication. Your game client integration, game server integration, and cloud-save service can use the ID to securely access player data from Play Games Services.

A player ID is consistent for a user when they play your game on multiple devices. However, it is not always consistent between games. For more information, see next generation Player IDs.

OAuth Scopes

Play Games Services relies on the OAuth system to allow players to give your game access to their account. Play Games Services has a unique scope for games (games-lite) and relies on another scope (drive.appdata) if your game uses the saved games feature. The saved games feature gives access to the user's Google Drive account, which is where the game data is stored.

When using the Play Games Services v2 SDK, you can request extra OAuth scopes. If you need extra OAuth scopes, we recommend calling requestServerSideAccess. For more information, see get the server auth code or retrieve server authentication codes.

Multiple authentication services

Play Games Services provides a gaming identity for Android players, but it doesn't need to be the only identity connected to your users. You can authenticate players using Play Games Services, a social network ID, and your own in-game ID system all at the same time.

Recall API

The Recall API lets games manage links between PGS users and their in-game accounts by storing recall tokens with Google servers. To learn more about enabling this feature, see Integrate the PGS Recall API within your game.

Game client integration

When integrating authentication into your game project, we recommend the following user flow:

  1. During the startup sequence of your game, Profile creation launches and attempts to authenticate the user or create a new account.

  2. If automatic authentication fails or you decline, show a manual sign-in button so you can authenticate later.

For information about integrating authentication in your game project, see the documentation for your project type:

Game server integration

You can obtain a server authorization code by calling requestServerSideAccess once you have verified that the player is authenticated. Pass this server authorization code to your backend game server to communicate directly with Play Games Services servers. This communication allows your server to access player data, including:

  • Player ID
  • Profile
  • Friends list
  • Game progress
  • Achievements

Your server then uses this authorization code with the REST API to interact securely with Play Games Services servers. For more information, see Server-side access to Play Games Services.

Login request quota

There is a daily quota for login requests with Play Games Services. For more information, see Managing your daily quota.