Authentication
Access the Steam authentication system with Heathen's Steam API
Last updated
Access the Steam authentication system with Heathen's Steam API
Last updated
Support us as a GitHub Sponsor and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our GitHub Sponsors ... become a sponsor today!
The Authentication API will use the Server or Client version of Valve's Steam API as required. It is not separated into a .Client or .Server version like other APIs as all features are exactly the same between them.
The Authentication has both client and server interfaces that are identical. Heathen's Steam API wrap's these in a single call which will call the appropriate client or server interface for you based on the build type in Unity.
The Authentication interface can be used to generate and validate session tickets. This is most commonly used with Steam Game Server but can also be used to for inventory verification or other similar verified processes.
Tickets this player has sent out.
Sessions the player has started.
Determines if the provided ticket handle is valid
Encodes a ticket to hex string format
This is most commonly used with web calls such as https://partner.steamgames.com/doc/webapi/ISteamUserAuth#AuthenticateUserTicket
The callback delegate should be in the form of
Requests a new Auth Session Ticket
Cancels the auth ticket rather its client or server based.
The callback deligate should be in the form of
Starts an authorization session with the indicated user given the applied auth ticket
Ends the auth session with the indicated user if any
Checks if the user owns a specific piece of Downloadable Content (DLC).
Ends all tracked sessions
Cancels all tracked tickets
To authenticate the user who needs to be authenticated will first get a ticket and then send that data to the entity that will be doing the authentication ... so typically a client gets a ticket and sends it to a server.
The act of sending your ticket data to your server or the other client that wishes to authenticate you is up to your networking solution. Rather that is Mirror, MLAPI, Forge, etc. you will need to send the ticket.Data to that user.
Valve added a new parameter to the Get Authentication Ticket process where its necessary to identify who the ticket is intended for. The targetSteamId parameter is simply that the Steam ID of the user or Steam Game Server that will be using the ticket.
When ticket data is recieved you need to begin the auth session with that user and confirm the status of that session.
You can find details on the possible values for the EBeginAuthSessionResult result here:
Rather from the authenticated user or the authenticating system a session should be ended when its no longer needed.
To cancel a ticket you sent out
To cancel all tickets you sent out
To end a session you started
To end all sessions you started
Your systems should maintain track of its tickets and sessions however the Authenticaitton API does keep a record of all active sessions and tickets.
Do not add or remove tickets or sessions manually
the API.Authentication.ActiveTickets and API.Authenticaiton.ActiveSessions lists can be used to iterate over the active tickets and sessions as required.