Steam as a login provider
Steam supports OpenID 2.0. After sign-in the site gets the player's 64-bit SteamID and nothing else.
Steam login gives no email and no profile. It gives certainty that the player controls the account with a given SteamID. The rest, name, avatar, playtime and bans, we fetch separately from the Steam Web API with a key kept on the server.
On game servers the SteamID is usually already the key in the database: in permissions, stats and bans. So linking the site to the game by SteamID is natural and needs no codes typed by the player.
- OpenID endpoint
- https://steamcommunity.com/openid/, as given in the Steamworks docs.
- 100,000 a day
- That many Steam Web API calls are allowed by the key's terms of use.
Steam login step by step
The most important is step four: without check_authentication a SteamID can be forged.
The Steam Web API methods we use
Player data after sign-in. Some of it depends on profile privacy settings.
| Method | What it returns | What for |
|---|---|---|
| ISteamUser/GetPlayerSummaries v2 | name, avatar, profile URL, visibility, up to 100 players at once | the profile in the panel and leaderboard |
| IPlayerService/GetOwnedGames | games and playtime, if visible | rewards for playtime |
| ISteamUser/GetPlayerBans | VAC and game bans, days since the last ban | server access decisions |
| IPlayerService/GetSteamLevel | the Steam account level | a threshold for new accounts, e.g. in giveaways |
| ISteamUser/CheckAppOwnership | whether the player owns a given game | only for the game's publisher, with a publisher key |
What the SteamID ties together on the site and in game
One player account everywhere.
Player identity
Steam login
Name and avatar
login and a periodic refresh
Playtime
a periodic job, if the profile shows it
Item shop purchases
a payment on the site
the item or rank reaches the server by SteamID
Bans
login or joining the server
05
What we watch out for with Steam
Mistakes that open player accounts to takeover or end in a blocked key.
- 01
Security
Always check_authentication
A SteamID from the URL without Steam's confirmation can be forged with one URL edit.
- 02
The Web API key on the server only
A key in front-end code would be taken by anyone who opens the browser dev tools.
- 03
Profile cache
With 100,000 calls a day, asking Steam on every page view quickly uses up the limit.
- 04
Private profiles
Playtime is available only when the data is visible. Playtime rewards show a clear message when the profile hides it.
- 05
Batched requests
GetPlayerSummaries takes up to 100 SteamIDs at once, so we refresh leaderboards in batches.
Example: playtime rewards on a server
The rollout, step by step.
Scenario
Steps
- 01 Steam login
- 02 Playtime from the server
- 03 Rewards
- 04 Abuse protection
Step 01 of 04
Steam login
The site account appears at first login, with SteamID, name and avatar straight away.
Step 02 of 04
Playtime from the server
Playtime on your server is counted by the server itself by SteamID. Steam data is only an extra when the profile shows it.
Step 03 of 04
Rewards
Past a threshold the panel grants a reward, and the server hands it over at the player's next join.
Step 04 of 04
Abuse protection
Accounts with a VAC ban or very new accounts are excluded from giveaways, by your rules.
Result
The player signs in once, and the site, panel and server know who they are, with no SteamID to type.
Common questions about Steam integration
The main questions about Steam: player email, the API key, Discord, cost and code.
Will we get the player's email?
How long does it take?
How much does Steam login on a game server website cost?
Can Steam be combined with Discord login?
Is a Steam Web API key paid?
Will the Steam integration code be mine?
How do you check Steam login before launch?
What if the Steam integration stops working?
What if Steam changes its API?
Sources
Technical details come from the Steamworks documentation and the OpenID spec.
Describe your project.
A free quote comes back within an hour during working hours.