Skip to main content
Version: 5.x

JSON Web Token Authentication

The jwt provider lets you use your own authentication system: your service issues a JSON Web Token, and Redwood verifies it with the secret used to sign it. The player's Redwood account is linked to the value of a claim in the token (the sub claim by default), so the same user always gets the same account.

Configuration​

VariableDescription
auth.allowed-providersMust include jwt
auth.jwt.secretA string specifying the secret used to sign the JWT. This can be used with the secrets system.
auth.jwt.claim-fields.provider-idA string specifying the name of the claim that should be used as the provider ID (the unique ID of the user in your system). Defaults to sub.

Unreal​

There's no dedicated node for this provider. Use the normal Login node (URedwoodClientGameSubsystem::Login) with:

InputValue
UsernameThe value of the token's provider ID claim (e.g. its sub); it must match exactly
Password (PasswordOrToken in C++)The JWT
Providerjwt

If the token is invalid, its signature doesn't match auth.jwt.secret, or the username doesn't match the claim, Login reports an Error with Invalid JWT login details. On a player's first login, Redwood creates their account with the claim value as both their username and nickname.