Skip to content

OIDC sign-in for games (any provider)

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.

Choose an environment in the header, open Project settings → Authentication and add an OpenID Connect connection.

FieldMeaning
IssuerThe issuer URL of the provider, such as https://sso.example.com. Its discovery document names the keys.
Client idsThe audiences your tokens carry, comma separated.

The game signs in with the provider itself and sends the ID token.

import { Session } from '@rudder/sdk';
const session = await Session.signIn(key, {
provider: 'corp-sso',
payload: { idToken },
});
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.

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.

  • 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.