Authentication
Quick Start
Steam Authentication allows your game to verify the identity of a user via Steam's backend services. It is commonly used for multiplayer games, server access control, and web API integration. The system issues authentication tickets that can be validated by other clients, game servers, or your own backend.
You should use Steam Authentication when:
You need to verify a player's identity in multiplayer sessions.
You want to authenticate users with your backend or web services.
You're integrating with Steam Web API endpoints that require proof of identity.
You don’t need to use Steam Authentication when:
Your game is entirely single-player and doesn’t rely on server-side identity checks.
You're using Steam only for basic platform features like achievements or cloud saves.
Authentication is handled entirely via Steamworks API and does not require any setup in the Steamworks Developer Portal.
Examples
Get Ticket
When requesting an authentication ticket, you must specify the intended recipient of the ticket—this is referred to as the "identity." The identity is who the ticket is for, not who is generating it. This means you should provide the Steam ID of the server, user, or Web API key that will receive and validate the ticket, not your own ID.
Code Free
You can use the Authentication modular component to work with Authentication in your game.

Add the Get Ticket setting to enable the Get Ticket features

You can now call Get Ticket from other scripts or Unity Events, this will store the resulting data in the Authentication object for later use
Example

Options include
Get Ticket for Game Server This takes a Game Server component reference and generates a ticket for that server.
Get Ticket for Lobby Owner This takes a Lobby component reference and generates a ticket for that Lobby's owner
Get Ticket for Lobby Server This takes a Lobby component reference and generates a ticket for that Lobby's Game Server
Get Ticket for User This takes a User component reference and generates a ticket for that User
Get Ticket for Web API THis takes a string being the identity used by a given Web API and generates a ticket for that web API.
You can add the General Events component and make use of the Changed event which will be invoked when the ticket is ready to use.

Additionally you can add the RPC Invoke setting and make use of the RPC Invoked event. This will raise when the ticket is ready and will format the data in the manner typically used by HLAPI's such as NetCode for GameObjects, PurrNet, Mirror, FishNet, etc.

C#
To get a ticket for use by a User or Steam Game Server, you will provide that user's or server's ID
For Web Auth Tickets its similar but we use a string as the identity
Blueprint
Keep in mind that the Game Server and User versions are different. So if you are doing this from a Dedicated server that has initialised Steam Game Server ... then use the Steam Game Server version.
In most cases, e.g., when running from a client build or Listen Server, you would use the User versions.

Note that the Web Auth Session Ticket request is asynchronous, while the standard request is not.
C++
Begin Session
When you receive a ticket from a user, you use it by calling Begin Auth Session. This function first checks the ticket’s structure for validity. If the structure is valid, Steam processes the ticket on the backend, performs authentication, and returns the result to you.
Code Free
You can use the Authentication modular component to work with Authentication in your game.

Add the General Events and Sessions settings.

Use the Accepted Responses to indicate which response values should result in a successful authentication session. The only "pure" accept is "OK" however you may wish to allow "non-secure" servers in which case you might also add VAC Banned and VAC Check Timed Out

To call Sessions you should have your programmer add an event so you know when your server or host receives the ticket.
Example:

You can then link the BeginSession call to that event as shown above. You can use the following Events on the General Events feature to handle each of the possible Authentication cases.

Invalid Ticket Received This occurs when the ticket provided is malformed or otherwise structurally invalid.
Invalid Session Requested This occurs when the response from Steam for your Begin Session request is not defined in your Accepted Responses.
Session Started This occurs when the respons from Steam for your Begin Session request is defined in your Accepted Responses.
C#
Blueprint
Be aware of the Client vs Steam Game Server versions

C++
In the example below, we are assuming your input Ticket came in as a TArray<uint8> so we need to convert that to a traditional uint8 array for Steam.
We are also using Heathen's Steam Tools Subsystem to handle the callback. In this case, the input function is expected to take the form of:
End Session
When you are done playing with a user or otherwise wish to end the authenticated session with them, you need to call End Session on that user.
Code Free
You can use the Authentication modular component to work with Authentication in your game.

Add the General Events and Sessions settings.

You can use the Sessions feature to call End or EndAll to end sessions with a specific user or all users.

End and End All does —NOT— affect your network, it is up to you to end/close connections via your HLAPI of choice.
C#
Last updated
