Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Official Authentication Cross-Platform Features

Discussion in 'Authentication' started by avnishb_unity, Nov 14, 2023.

  1. avnishb_unity

    avnishb_unity

    Unity Technologies

    Joined:
    Oct 6, 2021
    Posts:
    9
    One of the major trends in game development is the rise in multiplatform games that span across mobile, desktop, and consoles. These multiplatform games lead to player expectations to support cross-platform capabilities. Players want the flexibility to choose their preferred gaming platform and expect smooth transitions between devices.

    UGS now offers a robust cross-platform suite of account and authentication solutions that support cross-play and progression across all major devices and platforms: Android, iOS, Windows, MacOS, and consoles. In addition, developers can now integrate UGS with any custom authentication system through OpenID Connect and Custom Token Exchange, making it easy for games with custom identity solutions to unlock the full power of UGS.

    Learn more about our cross-platform solutions and how they can support your use cases:

    1. Code link

    Code link provides simple and fast cross-platform identity support across mobile, desktop, and console devices by generating simple codes on one logged in device that can be used to sign in on another device.

    You can provide your players with the flexibility to move across platforms without requiring them to enter their login credentials multiple times and completely avoid third party sign-ins. Code linking supports both anonymous and platform-specific sign-in methods.

    For example, a player can start a game anonymously on their Android device. After reaching level 2, they decide to continue progress on their console device. The player can open the game on their console to generate a code, which they enter into their Android device. Once confirmed, they can continue playing on their console.

    Code linking is available for SDK versions 3.0.0 and newer.



    To configure code linking within your Unity Dashboard account:
    1. Within the Authentication section of Dashboard, select Code Linking as the Identity Provider
    2. Add the provider
    3. Code Linking will appear in your dashboard, where you can enable, disable, or delete as needed


    Learn more code link

    2. Unity Player Accounts

    Unity Player Accounts is our premier out-of-the-box sign-in and identity solution built for gaming. It’s built for developers that require a cross-platform, cross-device and/or cross-game identity provider for their players, but don’t want to build a custom identity solution or rely on a 3rd party account provider (e.g. social networks). It is seamlessly integrated with the UGS (Unity Gaming Services) and Unity ecosystem.

    Previously in Beta, Unity Player Accounts is now available as a general availability (GA) solution that is supported across a range of platforms and devices, including iOS, Android, Windows, and MacOS.

    Your players can create a single account that can be used for any game that supports Unity Player Accounts as a sign-in provider. You can also provide a persistent player profile across all your games that leverage Unity Player Accounts through our organization-level player identifiers.



    Once you install the SDK, you can use Dashboard to configure your Unity Player Account settings:
    1. Within the Authentication section of Dashboard, select Unity Player Accounts as the Identity Provider.
    2. Set up Unity Player Accounts by adding your game’s name and supported platforms. The TOS and Privacy Policy can be added once you are ready to go live with your game.
    3. Unity Player Accounts will appear in your dashboard, where you can enable, disable, or delete as needed.
    Learn more about Unity Player Accounts

    3. Username and Password

    The username and password feature lets your players log into your game with game-specific sign-in credentials. This enables you to build an authenticated user base within your game without needing to rely on third party sign-in solutions. And what’s more, username and password authentication can be customized to seamlessly integrate with your game’s aesthetics.

    Username and password also works cross-platform, providing players with the ability to continue their game progress across devices and platforms.

    Learn more about username and password



    4. Bring Your Own Identity (BYOID)

    If you already have your own custom identity solution and want to continue to use it with UGS, you can do so with our Bring Your Own Identity solutions: OpenID Connect (OIDC) or Custom ID.

    The OpenID Connect solution enables you to use your existing OIDC-compliant identity solution in your game, such as PlayFab, Firebase, Epic Online Services, among others.

    If your custom identity solution is not OIDC-compliant, you can use the Custom ID feature to integrate with UGS. This allows you to exchange Unity service account tokens and your custom user id for Unity Authentication Player ID and tokens.

    Both OpenID Connect and Custom ID solutions are supported across all major platforms. As long as a platform is supported by your custom identity solution, you can use the Bring Your Own Identity solution to offer game progress on those devices.

    Learn more about OpenID Connect and Custom ID

    We want your feedback! Please take our short cross-platform survey and let us know what’s useful and what we can improve.
     
    Last edited: Nov 22, 2023
  2. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    When we login anonymously on an Android device and when the game is reinstalled then it logs in as a new user. In Playfab we can use device ID to login as guest user. can we achieve the same using UGS?
     
  3. chengg_unity

    chengg_unity

    Unity Technologies

    Joined:
    May 15, 2022
    Posts:
    68
    Hello @sathya ,
    Currently, Authentication doesn't have built-in LoginWithAndroidDeviceID functionality. An alternative I can think of is retrieving the player's device ID and using Custom ID. Similar with client side login with device id, the account security could be a potential issue.
     
  4. elevenab_unity

    elevenab_unity

    Joined:
    Mar 9, 2020
    Posts:
    15
    Hey, Im working with Mr. Sathya on the same project.
    In order to feed the details of ProcessAuthenticationTokens(accessToken, sessionToken)
    I first get the access token using https://services.api.unity.com/auth/v1/token-exchange REST api
    then
    I get both the fields required using https://player-auth.services.api.unity.com/v1/projects/ REST api

    Is that the right approach?
     
  5. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
  6. srkn122016

    srkn122016

    Joined:
    Aug 9, 2020
    Posts:
    2
    Hello, my phone number changed and I lost my recovery codes. How can I change my Two Factor Authentication phone number? Can you please help? I cannot receive payment due to this problem.
     
  7. srkn122016

    srkn122016

    Joined:
    Aug 9, 2020
    Posts:
    2
    Even though I opened a ticket many times, you did not solve the problem. Shame on you....
    @chengg_unity
     
  8. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,814
    If the user authenticates with deviceID, I want to be able to upgrade them to a proper user with an email/phone linked.

    How can I let my users sign in with passwordless authentication, using their email or phone?
    i.e they are sent a code to their phone or email, then enter this same code in the game.