Nebula
Gateway

AuthResult

Outcome of checking the token a client presented in Hello (see OidcTokenValidator).

generated from the sources
public struct AuthResult

Outcome of checking the token a client presented in Hello (see OidcTokenValidator).

Fields

Ok

public bool Ok;

The token was valid; Identity, Issuer and Subject are set.

Identity

public string Identity;

The player's stable identity (PlayerIdentity.Derive).

Issuer

public string Issuer;

The token's iss claim: the OpenID provider, or PlayerIdentity.AnonymousIssuer for a gateway-issued token.

Subject

public string Subject;

The token's sub claim: the provider's user id.

Error

public string Error;

Why the token was rejected (empty when Ok).

Claims

public Dictionary<string, object> Claims;

Every claim of the verified token, as parsed JSON (strings, doubles, booleans, lists and objects). Set only for a token verified against a trusted OpenID provider; null for a gateway-issued anonymous token. The gateway forwards the claims NebulaConfig.ForwardedClaims names from here (PlayerClaims.Select).

Methods

Fail

public static AuthResult Fail(string error);

Accept

public static AuthResult Accept(string issuer, string subject);
public static AuthResult Accept(string issuer, string subject, Dictionary<string, object> claims);

An accepted token, with the verified token's claims (null for none).

On this page