OIDC sign-in for games (any provider)
Before you start
Section titled “Before you start”A client registered with the identity provider of your company or of your customer, and its
discovery document: <issuer>/.well-known/openid-configuration must name the keys. The provider
has to sign with RS256; a provider without a discovery document or without RS256 keys is set up
through the webhook instead.
In the Dashboard
Section titled “In the Dashboard”Choose an environment in the header, open Project settings → Authentication and add an OpenID Connect connection.
| Field | Meaning |
|---|---|
Issuer | The issuer URL of the provider, such as https://sso.example.com. Its discovery document names the keys. |
Client ids | The audiences your tokens carry, comma separated. |
In the game
Section titled “In the game”The game signs in with the provider itself and sends the ID token.
TypeScript
Section titled “TypeScript”import { Session } from '@rudder/sdk';
const session = await Session.signIn(key, { provider: 'corp-sso', payload: { idToken },});C# and Unity
Section titled “C# and Unity”using RudderSdk;
var session = await Session.SignInAsync(key, new ProviderSignIn{ Provider = "corp-sso", Payload = new Dictionary<string, object?> { ["idToken"] = idToken },});corp-sso here is the name you gave the connection, not a provider kind.
What the platform checks
Section titled “What the platform checks”The platform reads <issuer>/.well-known/openid-configuration, loads the keys it names, and
checks the signature, the issuer, the audience and the expiry. The player is the sub of the
token; its name and picture fill a nickname and an avatar the player does not have yet.
The keys are cached for an hour, and a token signed with a key that is not cached yet makes the platform read them again.
Errors
Section titled “Errors”- A token with a foreign issuer or audience, or one that is expired, answers
401 unauthorized. - The provider not answering its discovery document or its keys answers
503 try_again.
The rest are in Errors.