![]() ![]() Sign into the cached player's account using SignInAnonymouslyAsync.If a cached player exists on the SDK, then you have the option of linking the cached player to the Steam Account. Then, call the LinkWithSteamAsync API to link the player to the Steam session ticket. } Update a player from anonymous to a Steam account #Īfter you’ve set up anonymous authentication, if the player wants to upgrade from being anonymous to creating a Steam account and sign in using a Steam account, the game should prompt the player to trigger the Steam sign-in and get the session ticket from Steam. Compare error code to CommonErrorCodes Notify the player with the proper error message Compare error code to AuthenticationErrorCodes Call Unity Authentication SDK to sign in or link with Steam.Īsync Task SignInWithSteamAsync(string ticket, string identity)Īwait (ticket, identity) Token = BitConverter.ToString(callback.m_rgubTicket).Replace("-", string.Empty) ĭebug.Log("Steam Login success. Void OnAuthCallback(GetTicketForWebApiResponse_t callback) M_AuthTicket = SteamUser.GetAuthTicketForWebApi("unityauthenticationservice") M_AuthTicketForWebApiResponseCallback = Callback.Create(OnAuthCallback) See GetAuthSessionTicket document for details. Create the callback to receive events when the session ticket member variable to prevent the GC from cleaning it up. Callback.Create return value must be assigned to a It's not necessary to add event handlers if they are Encrypted Application Tickets are not accepted.Ĭallback m_AuthTicketForWebApiResponseCallback ![]() Unity Authentication SDK accepts only Steam session tickets. Refer to the documentation of GetAuthTicketForWebApi. Implement the Steam login using the sample code below. Enter the Publisher Web API Key in the Key text field, then select Save.Enter the app ID in the App ID text field.Set ID Providers to Steam, then select Add.In the Unity Editor menu, go to Edit > Project Settings…, then select Services > Authentication from the navigation menu.The Steam user has the game you are developing in the library.Ĭonfigure your ID provider to be Steam for Unity Authentication: Before you test, make sure Steam is installed and logged in.Add the Steam Manager game component to a game object in the scene.Open the steam_appid.txt in the root of your Unity project and replace 480 with your own App ID.Copy the SteamWorks.Net SDK into your project’s Assets/ folder.Install the SteamWorks.Net SDK following instructions to install the SDK specifically for Unity. Set up a Steam account sign-in #Ĭreate your app and note down the app ID following the Steamworks documentation.Ĭreate the Publisher Web API key following the Authentication using Web API Keys documentation. To provide a steam sign-in option for the players in your game, create an app in the SteamWorks Partner Portal and install the Steamworks.Net SDK to sign in the user and get the session ticket. Updating a user from an anonymous sign-in to a platform sign-in via a Steam account.Sign in a returning user or create new user.This article guides you through the following scenarios in setting up authentication for player's in your game with a Steam account: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |