Steam Authentication
The steam provider uses the Steamworks API to authenticate users automatically when the game launches from Steam. If you distribute your game through Steam, this provider allows for a painless onboarding experience: there's no username or password, and the player's Redwood account is tied to their Steam account.
How it works:
- The
RedwoodSteamplugin asks the Steam client for a Web API auth ticket (for the identityredwood) - The plugin logs in to the Director with the provider
steamand the ticket - The Director verifies the ticket with Steam's
AuthenticateUserTicketAPI using your publisher key, rejects VAC-banned and publisher-banned accounts, and logs the player in (creating their account on first login)
The player's Redwood username is their SteamID64, and their nickname is set to their Steam persona name (refreshed on every login).
Configuration
| Variable | Description |
|---|---|
auth.allowed-providers | Must include steam |
auth.steam.api-key | The Steamworks Web API publisher authentication key. This can be used with the secrets system. |
auth.steam.app-id | The Steamworks AppID for your game. |
For example, in config/node/your-game/auth.yaml:
allowed-providers:
- "steam"
steam:
api-key: "secret|steam_api_key"
app-id: 480
Setup
-
Create a Steamworks Web API publisher key (not a user key) following Steam's documentation
-
Update the above configuration
-
Enable the
RedwoodSteamplugin by manually adding it to your.uprojectfile or viaEdit > Plugins -
Update your UE project's
Config/DefaultEngine.inito enable the Steam online subsystem, making sure to disable Steam networking:[OnlineSubsystemSteam]
bEnabled=True
bUseSteamNetworking=false
SteamDevAppId=<your-app-id>warningThere are no other configuration changes you need.
SteamAuthis automatically handled by theRedwoodSteamplugin. DO NOT change the NetDriver as other guides on setting up Steam with Unreal suggest; Redwood game servers are reached by IP address with the normal IP net driver. You also don't need to setDefaultPlatformService=Steam.noteNon-Shipping builds need
SteamDevAppId: the Steam online subsystem writes asteam_appid.txtfile from it when the game launches (and deletes it when the game closes), which lets you test without launching through the Steam client. Shipping builds don't do this and expect to be launched by Steam; following Valve's guidance, don't ship asteam_appid.txtwith your game. Read more in the official Unreal documentation. -
Update your project to use
LoginWithSteaminstead of the normalLogin. It has the sameFRedwoodAuthUpdateoutput asLogin, so the rest of your login flow stays the same. Add theRedwoodSteammodule to your.Build.csfile, includeRedwoodClientGameSubsystem.h,RedwoodClientInterface.h, andRedwoodSteamClientInterface.h, and call:URedwoodClientInterface* ClientInterface =
GetGameInstance()->GetSubsystem<URedwoodClientGameSubsystem>()->GetClientInterface();
URedwoodSteamClientInterface::LoginWithSteam(
ClientInterface,
FRedwoodAuthUpdateDelegate::CreateWeakLambda(
this, [this](const FRedwoodAuthUpdate& Update) {
if (Update.Type == ERedwoodAuthUpdateType::Success) {
// continue to the realm
}
}));GetClientInterface()returnsnullptrwhen running without the backend in PIE, so only call this when the backend is in use.
The Steam client must be running and logged in on the player's machine. Steam login doesn't use Remember Me (there's nothing to remember; the player is logged in again from Steam each launch).
If the plugin can't get a ticket from Steam (e.g. the Steam client isn't running, the player isn't logged in to Steam, or the Steam online subsystem isn't enabled), it only logs an error (LogRedwoodSteam) and the LoginWithSteam callback never fires. Add your own timeout to your login UI.