Approaches to authentication
Unity Authentication supports authenticating players anonymously and through external identity providers, including Google Play Games, Facebook, Apple, Steam, OpenID connect, and console-specific logins.
Anonymous authentication
Anonymous authentication is similar to a guest sign-in. It doesn’t require players to enter credentials or create a player profile. To implement anonymous authentication in your app, make an API call to Unity Authentication. The service creates the PlayerID and the associated session token. Refer to How to use Anonymous Sign-in for more information.
This method provides the lowest friction for players in a game because it doesn’t require player input. However, anonymous authentication isn't portable across devices because there is no way to re-authenticate the player from another device. To sign in to the same game with the same player profile from a different device, players must use an external identity provider.
Note: Anonymous authentication is a way to describe the process of authenticating the player without collecting or using their personally identifiable information.
Platform-specific / third-party authentication
Platform-specific authentication (also called third-party authentication or external authentication) uses external identity providers. This means that you must create an identity provider configuration so that Unity Authentication can validate the player, making it possible to authenticate the same player from multiple devices.
Typically, the process begins when a player signs in through an external identity provider with their email address, or their username and password. When a player signs in, a token is sent to Unity Authentication for validation. If the token is validated successfully by the external identity provider, the token is then associated with the PlayerID.
Attention: The following concerns products or services (each a “Third Party Product”) that are not developed, owned, or operated by Unity. This information may not be up-to-date or complete, and is provided to you for your information and convenience only. Your access and use of any Third Party Product is governed solely by the terms and conditions of such Third Party Product. Unity makes no express or implied representations or warranties regarding such Third Party Products, and will not be responsible or liable, directly or indirectly, for any actual or alleged damage or loss arising from your use thereof (including damage or loss arising from any content, advertising, products or other materials on or available from the provider of any Third Party Products).
These external identity providers are supported by Unity Authentication in the following ways:
- Unity Player Accounts: Players authenticate with their Unity Player account credentials. A player's experience (and Player ID) is consistent across devices if they use the same account to authenticate. You must configure an identity provider for Unity Authentication with the Unity Player Account Client ID for the game to enable Unity Player Account as an ID provider. Refer to Unity Player Accounts sign-in.
- Google: Players authenticate with their Google account credentials. A player's experience (and Player ID) can be maintained across Android devices if they use the same account to authenticate. You must configure an identity provider for Unity Authentication with the OAuth Client ID for the game to enable Google as an external ID provider. Refer to Google sign-in.
- Google Play Games: Players authenticate with their Google Play Games account credentials. A player's experience (and Player ID) can be maintained across Android devices if they use the same account to authenticate. You must configure an identity provider for Unity Authentication with the OAuth Client ID for the game in order to enable Google as an external ID provider. Refer to Google Play Games sign-in.
- Facebook: Players authenticate with their Facebook account credentials. A player's experience (and Player ID) is consistent across devices if they use the same account to authenticate. You must configure an identity provider for Unity Authentication with the Facebook Application ID and Facebook Application Secret for the game to enable Facebook as an external ID provider. Unity Authentication only accepts USER token types from Facebook for authentication. Refer to Facebook sign-in.
- Apple: Players authenticate on iOS devices with their Apple account credentials. A player’s experience (and Player ID) is consistent across Apple devices if they use the same account to authenticate. You must configure an identity provider for Unity Authentication with the OAuth Client ID for the game in order to enable Apple as an external ID provider. Refer to Apple sign-in.
- Steam: Players authenticate with their Steam account credentials. A player's experience (and Player ID) is consistent across devices if they use the same account to authenticate. You must configure an identity provider for Unity Authentication with the Steam Application ID and Steam API Key for the game in order to enable Steam as an external ID provider. Refer to Steam sign-in.
- Oculus (Meta Quest): Players authenticate with their Oculus account credentials. A player's experience (and Player ID) is consistent across devices if they use the same account to authenticate. You must configure an identity provider for Unity Authentication with the Oculus Application ID and Client Secret for the game to enable Oculus as an external ID provider. Refer to Oculus sign-in.
- Apple Game Center: Players authenticate with their Apple Game Center credentials. A player’s experience (and Player ID) is consistent across devices if they use the same account to authenticate. You must configure an identity provider for Unity Authentication with the Apple Bundle ID for the game to enable Apple Game Center as an external ID provider. Refer to Apple Game Center sign-in.
Custom authentication
You can integrate your own custom authentication solution with Unity Authentication. To do this, you must create an identity provider configuration for your custom authentication system so that Unity Authentication can validate the player. This would make it possible to authenticate the same player from multiple devices.
Unity Authentication supports authenticating players through a custom ID provider with the OpenID Connect protocol and using your own game server to perform Custom ID authentication (refer to Custom ID sign-in).
When the game starts up, Unity Authentication checks if there’s a valid persisting session. If there is not, then game developers can provide login options for their players. Options depend on which platform the game is running on. After authenticating a player, the game indicates if there is a way to link anonymous players to external ID providers or unlink anonymous players from external ID providers.
Note: Unity supports console-specific logins for Xbox®, and PlayStation® Network (PSN). For more details, contact us through the Unity support portal.