User authentication
In Steam, users are always “signed in” when the client launches the game. The game can always access the user’s Steam ID without doing anything except initializing the API. Authentication in Steam refers to the process of checking whether a user’s preset identity is actually the user who’s signed in to the client that launched the game, using theISteamUser API with session tickets (with peer-to-peer or a dedicated server), encrypted application tickets (with a secure server), or the Steam Web API. After authenticating, the Steam Web or ISteamUser APIs can use tickets to verify ownership of the current game or its downloadable content (DLC).
This verification step is unnecessary in the XBOX Game Development Kit (GDK), because you’ve already done the verification when you signed the user in with the steps in Initializing the XBOX Game Development Kit (GDK). Thus, the XBOX Game Development Kit (GDK) doesn’t have an analog for the Steam session tickets or encrypted application tickets to verify a user’s identity for multiplayer sessions.
Ownership and digital rights management (DRM)
To verify that the user is entitled to the game that they’re currently playing, you need to use theXStoreQueryGameLicenseAsync function in the XStore API to check that the user has a license to play that game. In the async callback, check if:
- The query succeeded (that is, the user has a license).
- The license provided from
XStoreQueryGameLicenseResultis still active.
ISteamUser/CheckAppOwnership in the Steam Web API or by calling SteamEncryptedAppTicket::BIsTicketForApp with an app ticket.
For more information and a code sample about performing this check, see XStore: Basic DRM and license checks. This topic also has information about more robust license checking options that exist to prevent tampering to bypass this client-side check.
Steam also provides a DRM wrapper that the XBOX Game Development Kit (GDK) doesn’t have an analog to. Microsoft Store does an anti-piracy check when launching apps that are installed from it. For full DRM protection, we recommend using a third-party solution in addition to running the license check in the linked code sample.
Checking ownership for DLC
If your game has DLC associated with it, you can check whether a user’s Microsoft Store account has access to an item with theXStore API. To check these licenses, you first need to query for all the associated products with your game by using the XStoreQueryAssociatedProductsAsync function and then use the XStoreAcquireLicenseForPackageAsync function, which is similar to the ISteamUser/CheckAppOwnership or ISteamUser::UserHasLicenseForApp functions, to get the license for a specific DLC item in the list that was returned from your query.
Like checking entitlement for games, you need to see if the license was successfully acquired and if it’s active. If both checks pass, you can then consider that the user is licensed to access that DLC item. For a code sample for this process, see Manage and license optional packages (DLC).
