이 페이지는 아직 한국어로 번역되지 않았습니다.

Overview

Steamworks exposes multiple methods for authenticating a Steam user's identity and verifying ownership of an application. The following document describes each of these authentication methods used in the following scenarios:

Between a game client and other clients (P2P) or game servers using Session Tickets

Identifying a user within Steam

Every Steam user can be uniquely identified by a 64-bit numeric ID, known as the user's Steam ID. In the Steamworks C++ APIs, a user's SteamID is contained within a CSteamID object. You can retrieve the current user's SteamID by calling ISteamUser::GetSteamID and then retrieve the 64-bit ID by calling CSteamID.ConvertToUint64() on the returned value.

The following authentication methods can be used to securely verify a user's Steam ID.

APIs covered in this document

Session Tickets

Session Tickets are signed tickets that can be used to verify a user's identity between the user's game client and any number of other game clients (such as in a peer-to-peer multiplayer session) or to a listen/dedicated game server (using the ISteamGameServer API). These tickets can also be used to verify ownership of the current game and related downloadable content, and determine if the user has been VAC-banned (See Valve Anti-Cheat (VAC) and Game Bans).Session Tickets can also be used to verify a user's identity between a game client and a secure, backend server using the Steamworks Web API. Requires that the secure server can make HTTPS requests to api.steampowered.com.

Encrypted Application Tickets

Encrypted Application Tickets can be used to verify a user's identity between a game client and a secure, backend server. Unlike Session Tickets, verifying Encrypted Application Tickets does not require that the secure server can make HTTPS requests. Instead, a C++ library and a private, symmetric key are used by the secure server to verify the ticket. The Steamworks SDK includes 32-bit and 64-bit versions of this library for Windows and Linux under the public/steam/lib directory.Before using Encrypted Application Tickets, you must generate a private key for each title. You can do this by navigating to Edit Steamworks Settings for your application and selecting 'SDK Auth' from the 'Security' drop-down. This key will be associated with your title's AppID and any downloadable content for that title.

NOTE: These keys must be stored securely, and must not be distributed within your application in any way!

Steamworks Web API

Steam exposes an HTTP based Web API which can be used to access many Steamworks features. The API contains public methods that can be accessed from any application capable of making an HTTP request, such as game client or server. The API also contains protected methods that require authentication and are intended to be accessed from trusted back-end applications. More details on the Web API can be found here.

P2P or Game Servers

Session Tickets

User Authentication

The following steps detail how to use Session Tickets to verify a user's identity between the user's game client (client A) and another client or game server (client B):

Network conditions may prevent the Steam backend from providing a callback to the caller of ISteamUser::BeginAuthSession for an indefinite period of time. The caller of ISteamUser::BeginAuthSession ( client B ) should not assume that he knows the true identity of client A until this callback has been received, but should allow the multiplayer session to continue.

If the caller of ISteamUser::BeginAuthSession receives a ISteamUser::ValidateAuthTicketResponse_t callback stating that the ticket for client A is invalid, the caller must refuse to continue the multiplayer session with client A. If the other peers in the game do not also refuse to play with client A, the caller should leave the multiplayer session.

ISteamGameServer exposes the same Session Ticket methods to perform authentication between a game client and game server.

The secure server must make an HTTPS request to api.steampowered.com and call the ISteamUserAuth/AuthenticateUserTicket web method, passing the user's session ticket as a hex encoded UTF-8 string. Please note that this method requires a Web API Publisher Key that is associated with the AppID for the provided ticket.

Web Browser based authentication with OpenID

Steam is an OpenID Provider, as described in the OpenID 2.0 specification. Inside a web browser, a third-party website can use OpenID to obtain a user's SteamID which can be used as the login credentials for the 3rd party website, or linked to an existing account on that website.

When using OpenID, the user begins in a web browser at the third-party website. When the user wishes to login/link their account to that website, using OpenID, the site directs the user to a login form on the Steam Community website. Once the user has entered their Steam login credentials, the user's web browser is automatically redirected back to the 3rd party website with some additional OpenID specific data appended to the return URL. The site's OpenID library can then use this data to verify and obtain the user's SteamID.

Steam provides the following images which may be used by 3rd party sites when linking to the Steam sign in page:

User Authentication

Steam's OpenID 2.0 implementation can be used to link a users Steam account to their account on the third-party website.A list of open source OpenID libraries can be found at the OpenID website. To use OpenID to verify a user's identity:

Configure your OpenID library to use the following URL as Steam's OP Endpoint URL: https://steamcommunity.com/openid/

After a user has been authenticated, the user's Claimed ID will contain the user's SteamID. The Steam Claimed ID format is: http://steamcommunity.com/openid/id/<steamid>.

Examples

Linking third-party accounts to Steam accounts

Third-party accounts can be linked to Steam accounts by associating a user's SteamID with the 3rd party account.

A user's SteamID can be securely retrieved either in-game or through a web browser and once the initial association has occurred, you can safely allow access to the 3rd party account by merely verifying a user's SteamID. This eliminates the need for Steam users to do any sort of secondary login to 3rd party account systems. Additionally, if new 3rd party accounts can be automatically created and linked when a new SteamID is encountered, the Steam user will never have to be aware that a secondary authentication is taking place at all. Instead, their single Steam account can grant access to all of their games, streamlining the user experience and removing potential barriers to installing and trying new games.

Linking From In-game

Session Tickets can be used to verify a user's identity between a game client and a secure, backend server using the Steamworks Web API:

The secure server must make an HTTPS request to api.steampowered.com and call the ISteamUserAuth/AuthenticateUserTicket web method, passing the user's session ticket as a hex encoded UTF-8 string. Please note that this method requires a Web API Publisher Key that is associated with the AppID for the provided ticket.

Linking From a Web Browser

Steam supports the OpenID 2.0 specification so that you can allow users to securly log into their Steam accounts from your website and retrieve their SteamID. For details on how to use OpenID with Steam go to Using OpenID

Migrating from Third-Party CD Keys to native Steam Ownership Checks

Steam itself has a number of ways a title can authenticate a user with, removing the need for a third-party CD key. We've compiled a list of common use cases for CD Keys and how you might implement each case natively with Steam: