Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Official Unity Player Accounts is entering Open Beta!

Discussion in 'Authentication' started by chengg_unity, Jun 21, 2023.

  1. chengg_unity

    chengg_unity

    Unity Technologies

    Joined:
    May 15, 2022
    Posts:
    73
    Hello everyone!

    We are thrilled to announce that Unity Player Accounts is entering Open Beta. Unity Player Accounts is Unity’s comprehensive sign-in solution that supports persistence across platforms and devices. It’s an end-to-end account system that includes a user flow UX, email and password, social sign-in options, data access and deletion flows.

    As a developer, you can consider Unity Player Accounts as another identity provider that Authentication supports. Once added to your application, your players will be able to sign in using Unity Player Accounts.

    Documentation
    Please refer to our documentation for more information.

    Demo
    Dashboard Configuration





    In Game Experience
    upload_2023-6-21_16-41-11.gif

    What’s next?
    With Unity Player Accounts covering some cross-platform use cases, we will continue to work on extending UGS cross-platform support with features such as username & password.
     
    CodeSmile, Grizmu, saskenergy and 3 others like this.
  2. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    812
    Will username and password be able to have a userflow that is entirely in game where I can have my own popup for them to enter?
     
  3. chengg_unity

    chengg_unity

    Unity Technologies

    Joined:
    May 15, 2022
    Posts:
    73
    Yes, username and password will be a white label sign in method. Unlike Unity Player Accounts, you can have your own user flow and branding without leaving your game.
     
    MousePods likes this.
  4. Tazyooo

    Tazyooo

    Joined:
    May 12, 2020
    Posts:
    8
    Is there a sample project available on github?
     
    pKallv likes this.
  5. MiTschMR

    MiTschMR

    Joined:
    Aug 28, 2018
    Posts:
    523
    Do you have an estimate on when this is made available (closed or public beta)?
     
    steveb007 likes this.
  6. Tirt

    Tirt

    Joined:
    Jul 11, 2022
    Posts:
    9
    Can't find access to the sample. There is no "Unity Player Accounts" package
     
  7. Mj-Kkaya

    Mj-Kkaya

    Joined:
    Oct 10, 2017
    Posts:
    193
    Have you enabled preview packages in Package Manager? UPA.png
     
  8. MiTschMR

    MiTschMR

    Joined:
    Aug 28, 2018
    Posts:
    523
    It is named
    Player Accounts
    , omit Unity.
     
  9. steveb007

    steveb007

    Joined:
    Feb 10, 2022
    Posts:
    1
    How will PII and right to be forgotten be handled for Player Accounts if a player submits a request to have their data deleted? Also, I believe PII data in some cases must be stored within the region the player is located, how will Unity address this?
     
  10. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    907
    Are there any plans to also be an "out of the box" provider for Photon Authentication, like Steam is, for example?
     
  11. Tirt

    Tirt

    Joined:
    Jul 11, 2022
    Posts:
    9
    Found it! Just had to restart after enabling Pre-Release Packages!
     
  12. Evil-Otaku

    Evil-Otaku

    Joined:
    Oct 17, 2012
    Posts:
    79
  13. EnamulIslamJisan

    EnamulIslamJisan

    Joined:
    Oct 11, 2018
    Posts:
    94
    is webgl supported?
     
  14. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    812
  15. chengg_unity

    chengg_unity

    Unity Technologies

    Joined:
    May 15, 2022
    Posts:
    73
    Thanks for the question! Are you asking if Unity Authentication will support Photon Authentication as an identity provider?
    Unity Authentication supports a few providers including Steam, Google, Apple and others. Please refer to this doc for more details.
     
  16. OneManEscapePlan

    OneManEscapePlan

    Joined:
    Oct 14, 2015
    Posts:
    225
    Your official webpage and documentation are missing some key details:
    • Does your system support email verification?
    • Can players change their email address after account creation?
    • Do you have a password recovery process (e.g. email the player a link to recover their password)?
     
    Mj-Kkaya likes this.
  17. chengg_unity

    chengg_unity

    Unity Technologies

    Joined:
    May 15, 2022
    Posts:
    73
    Thank you for your feedback, @OneManEscapePlan ! We will update our documentation and official webpage.
    • Does your system support email verification?
      • Yes, when players use email and password to create an account, they will receive an email with a five characters code and the player enters the code to complete their sign up process.
    • Can players change their email address after account creation?
      • This is not supported today.
    • Do you have a password recovery process?
      • Yes. If players forget their password, they can click on "Forgot password?" from the sign-in page. They will then receive an email containing a link to reset their password.
    Thanks again for your feedback, please let us know if you have additional questions or feedback!
     
    Mj-Kkaya likes this.
  18. Tkrain42

    Tkrain42

    Joined:
    Jul 25, 2015
    Posts:
    43
    I'm getting the following when adding the package in Unity 2022.3.5f1:
    Code (CSharp):
    1. Library\PackageCache\com.unity.services.playeraccounts@1.0.0-pre.2\Runtime\PlayerAccountServiceInternal.cs(158,24): error CS0103: The name 'HttpUtility' does not exist in the current context
    (Actually 7 of these for various lines in the code)
    I have Authentication and Cloud Save installed. Is there another package I may be missing?
     
  19. Tkrain42

    Tkrain42

    Joined:
    Jul 25, 2015
    Posts:
    43
    * Update: Turns out you need to set the API Compatability level in Project Settings | Player to .NET Standard 2.1 (Mine was set to .NET Framework. Found that in another post on the Authentication forums... Might be good to put that in the description or prominently in the docs for users to see when they install the package.
     
    chengg_unity likes this.
  20. takachi_dev

    takachi_dev

    Joined:
    Feb 19, 2017
    Posts:
    3
    I went ahead with the implementation as per the documentation, but when I run PlayerAccountService.Instance.StartSignInAsync();, the URL field in the browser says "https://player-login.unity.com/ja/error error=invalid_request&error_description=The+request+is+missing+a+required+parameter+or+is+using+an+unsupported+parameter. . I have followed the documentation and implemented in order, but how do I resolve this?
     
  21. MiTschMR

    MiTschMR

    Joined:
    Aug 28, 2018
    Posts:
    523
    Did you follow the instructions also in the UGS dashboard and adding your identifier (that you get when onboarding in the dashboard) to the created PlayerAccounts scriptable object?
     
  22. takachi_dev

    takachi_dev

    Joined:
    Feb 19, 2017
    Posts:
    3
    Yes
     
  23. takachi_dev

    takachi_dev

    Joined:
    Feb 19, 2017
    Posts:
    3
    Sorry, it was a careless mistake on my part. I am developing for mobile, but I did not include PC in the Platform in the dashboard, which I should have done when validating with UnityEditor on PC.
     
    pKallv likes this.
  24. Yakirbu

    Yakirbu

    Joined:
    May 7, 2015
    Posts:
    28
    So we won't be able to customize the login page with the company's logo, It will always contain Unity's logo?
    If so, that's a big downside I guess.
     
    Last edited: Aug 13, 2023
  25. TomTheMan59

    TomTheMan59

    Joined:
    Mar 8, 2021
    Posts:
    356
    This will never happen. If you want to white label it, use the username/password. They won’t even allow you to get rid of the unity splash logo unless you pay a minimum of 400 for unity license. I guess they realized they make more money from people paying to remove their logo so their game doesn't seem look like an asset flip than just allowing people to remove it. :(
     
  26. Yakirbu

    Yakirbu

    Joined:
    May 7, 2015
    Posts:
    28
    Well at-least with the splash screen, they give you the option to remove it if you pay.
    In this case, we need to confuse our users, and redirect them to an unknown sign-in page, with a strange logo that they probably won't recognize. That's definitely not going to happen, at-least not for my projects.
    If they add tools for customization in the future, I"ll be happy to revisit this service.
     
  27. TomTheMan59

    TomTheMan59

    Joined:
    Mar 8, 2021
    Posts:
    356
    100%. I’m with you on that. Like I mentioned, just use the username/password integration they offer and you won’t even have to leave your app. Unity is great for development, but in the gaming community, its a stain on a game if you see that logo.
     
  28. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    907
    The entire point is to allow users to login with their UNITY player account. This is analogous to allowing your users to login with Google, for example. Would you expect to show your game’s logo instead of Google’s when offering Google authentication to your users? Your users very much expect to see Google’s logo when authenticating with Google.

    That’s what Unity player accounts is: a third party identity provider that you can use. It *needs* to be branded like the third party because that’s what your users are entering credentials into. They will use these same credentials when logging in to that provider on other games.

    “Unity greedy” is the most intellectually lazy, tired old saw on these forums and it never gets anyone anywhere and rarely has anything to do with the real technical details being complained about.
     
  29. Yakirbu

    Yakirbu

    Joined:
    May 7, 2015
    Posts:
    28
    Ah okay, probably should have read more about that before asking, but basically I thought the idea was something else, like a 3rd party service that handles most of the authentication procedure for you in a unified way. If it's a 'Sign in with Unity' solution, that's understandable.
     
  30. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    907
    “Unity authentication” itself is that. It can optionally take advantage of identity providers like this one and others.
     
  31. VentaGames

    VentaGames

    Joined:
    Jul 9, 2021
    Posts:
    168
    Hi there,

    I need some clarification since can't find the answer anywhere.

    On every app start (mobile app), i'm calling
    Code (CSharp):
    1. await PlayerAccountService.Instance.StartSignInAsync()
    and then,
    Code (CSharp):
    1.  
    2. await SignInWithUnity(PlayerAccountService.Instance.AccessToken)
    3.  
    This triggers the app to switch to Safari and then back.
    But, is this possible to log in silently in case the token is valid? In that case, what is the flow?
    Thanks!
     
  32. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    907
  33. VentaGames

    VentaGames

    Joined:
    Jul 9, 2021
    Posts:
    168
    I'm getting the following error:


    PlayerAccountsException: The Client Id is not configured.
    Unity.Services.PlayerAccounts.PlayerAccountServiceInternal.StartSignInAsync () (at ./Library/PackageCache/com.unity.services.playeraccounts@1.0.0-pre.2/Runtime/PlayerAccountServiceInternal.cs:66)

    What client id?

    This one? acc.png

    But it's there!

    Any help?
     
  34. MiTschMR

    MiTschMR

    Joined:
    Aug 28, 2018
    Posts:
    523
    You should have a file under Assets/Resources called PlayerAccountSettings looking like this: upload_2023-9-27_19-13-58.png
     
  35. Evil-Otaku

    Evil-Otaku

    Joined:
    Oct 17, 2012
    Posts:
    79
    You can also find it in Services -> Player Accounts -> Settings
    upload_2023-9-27_19-34-15.png
     
  36. VentaGames

    VentaGames

    Joined:
    Jul 9, 2021
    Posts:
    168
    Yes, thats it. Completely forgot about this file.
    Thanks.
     
  37. KevinCastejon

    KevinCastejon

    Joined:
    Aug 10, 2021
    Posts:
    111
    Once the sign-in process has started is there a way to cancel it?
    Simple use case:
    - The user starts the sign-in process (web browser page open and a waiting popup into the game with a cancel button)
    - The user changes his mind and clicks the cancel button on the app, so the SDK signin/signinfailed callbacks are unsubscribed.
    **Problem -> ** the user is still able to sign-in by completing the process into the browser, process that is still "awaited" internally by the SDK (as it actually sign the user in if he completes the browser steps).
     
    Last edited: Nov 1, 2023
  38. wgeorgio

    wgeorgio

    Joined:
    Nov 15, 2017
    Posts:
    32
    I am getting this
    Code (CSharp):
    1. WebRequestException: {"title":"INVALID_PARAMETERS","detail":"external token not provided","details":[],"status":400}
    2. Unity.Services.Authentication.WebRequest.SendAsync[T] () (at ./Library/PackageCache/com.unity.services.authentication@3.1.0/Runtime/Network/WebRequest.cs:45)
    I am trying this `
    await LinkWithUnityAsync(PlayerAccountService.Instance.AccessToken);`
    Let me know if there is another way to get the AccessToken.
     
  39. KevinCastejon

    KevinCastejon

    Joined:
    Aug 10, 2021
    Posts:
    111

    You have to first sign in with the UnityPlayerAccount SDK for the token to be present, by doing :
    Code (CSharp):
    1. await PlayerAccountService.Instance.StartSignInAsync();
    Have a look at https://docs.unity.com/ugs/manual/a...accounts#Set_up_Unity_Player_Accounts_sign-in
     
  40. KevinCastejon

    KevinCastejon

    Joined:
    Aug 10, 2021
    Posts:
    111
    UP
     
    wgeorgio likes this.
  41. wgeorgio

    wgeorgio

    Joined:
    Nov 15, 2017
    Posts:
    32
    Ok, now I have this...
    Code (CSharp):
    1. PlayerAccountsException: The Client Id is not configured.
    2. Unity.Services.Authentication.PlayerAccounts.PlayerAccountServiceInternal.StartSignInAsync (System.Boolean isSigningUp)
    Code (CSharp):
    1. await PlayerAccountService.Instance.StartSignInAsync();
    2.         await LinkWithUnityAsync(PlayerAccountService.Instance.AccessToken);
    I did put that line of code in and double-check my Client ID but I can't get past this.
     
  42. MiTschMR

    MiTschMR

    Joined:
    Aug 28, 2018
    Posts:
    523
  43. wgeorgio

    wgeorgio

    Joined:
    Nov 15, 2017
    Posts:
    32
  44. KevinCastejon

    KevinCastejon

    Joined:
    Aug 10, 2021
    Posts:
    111
    It furiously looks like @MiTschMR is saying.. Maybe try to reboot unity? You could also maybe triple check with the project dashboard into the browser and see if the ids are matching everywhere, but I run out of solution
     
  45. KevinCastejon

    KevinCastejon

    Joined:
    Aug 10, 2021
    Posts:
    111
    I report here what I think is a bug:
    - You can call the FriendsService.Instance.AddFriendAsync() with any id, even non existing (a random player name is then generated...), even with incorrect format, no error will be thrown.
    - Deleting that kind of outgoing request (awaiting for non-existing user to accept) is impossible if it were made with incorrect format (ie: with parenteses on the id string), as an error is thrown.
    We end up with stacked outgoing requests that cannot be deleted nor accepted (since no user is existing to accept it).
     
    Last edited: Nov 3, 2023
  46. KevinCastejon

    KevinCastejon

    Joined:
    Aug 10, 2021
    Posts:
    111
    I also report here another annoying thing:
    The FriendsService.Instance.RelationshipDeleted event and its callback parameter IRelationshipDeletedEvent is not separating the incoming friends request from the outgoing ones, making in it hard to determine whether it's a denied outgoing request or a cancelled incoming request
     
  47. KevinCastejon

    KevinCastejon

    Joined:
    Aug 10, 2021
    Posts:
    111
    Also a question : when an outgoing request is accepted by the other end, why does it delete the outgoing relationship and create a new friend one instead of changing its type? I think it's non-sense to have a IRelationshipAddedEvent in this situation, rather a kind of IRelationshipUpdatedEvent , plus there is no IRelationshipDeletedEvent thrown for the deleted outgoing relationship... In my opinion, there is a logic issue here.
     
  48. anotherquest

    anotherquest

    Joined:
    Nov 15, 2023
    Posts:
    2
    With the Unity Demo 3.1.0, scene UnityPlayerAccountsUIExample, after calling
    Code (CSharp):
    1. await PlayerAccountService.Instance.StartSignInAsync();
    In script PlayerAccountsDemo.cs, I,m getting the error in the browser:
    Code (CSharp):
    1. https://player-login.unity.com/error?error=invalid_request&error_description=The+request+is+missing+a+required+parameter+or+is+using+an+unsupported+parameter.
    Unity Log (XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX instead of my client_id):
    Code (CSharp):
    1. https://player-login.unity.com/v1/oauth2/auth?response_type=code&redirect_uri=http://localhost:49215/callback&response_mode=query&client_id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&state=78262571-175e-4703-a338-bd0399f17f74&code_challenge=-jgGIYzFdIQu09wHheY2_G42NF__GZqRSAmZU9J8iIU&code_challenge_method=S256&scope=openid;email;offline_access
    No error is thrown in Unity.

    Unity 2023.2.2
     
  49. Dotecin

    Dotecin

    Joined:
    May 30, 2017
    Posts:
    4
    it all works when I run from Unity editor, but once I build an UWP app I get a NullReference exception:

    Code (Boo):
    1. NullReferenceException: Object reference not set to an instance of an object.
    2.   at Unity.Services.Authentication.PlayerAccounts.PlayerAccountServiceInternal.StartSignInAsync (System.Boolean isSigningUp) [0x00000] in <00000000000000000000000000000000>:0
    3.   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0
    4.   at Unity.Services.Authentication.PlayerAccounts.PlayerAccountServiceInternal.StartSignInAsync (System.Boolean isSigningUp) [0x00000] in <00000000000000000000000000000000>:0
    I verified that PlayerAccountService.Instance is not null
     
  50. Nivagia

    Nivagia

    Joined:
    Sep 15, 2020
    Posts:
    7
    I have the same Bug on 3.1.0 and 3.2.0. When running from the Unity editor everything works fine. In my Android build I get a NullReference exception. I downgraded to Authentication 3.0.0 when the PlayerAccount package was not included in the Authentication package and now it works