Nebula
Gateway

AnonymousIdentityIssuer

Identities the gateway hands to clients that present no token: an HS256 token with iss PlayerIdentity.AnonymousIssuer and a random sub, which the client keeps and presents on its next connection to get the same AuthResult.Identity back.

generated from the sources
public sealed class AnonymousIdentityIssuer

Identities the gateway hands to clients that present no token: an HS256 token with iss PlayerIdentity.AnonymousIssuer and a random sub, which the client keeps and presents on its next connection to get the same AuthResult.Identity back. Every gateway of a mesh must use the same key (see NebulaConfig.AuthSigningKey).

Constructors

AnonymousIdentityIssuer

public AnonymousIdentityIssuer(byte[] key);

Methods

DeriveKey

public static byte[] DeriveKey(string secret);

A key from a configured secret (the mesh token, or a secret of its own).

LoadOrCreateKeyFile

public static byte[] LoadOrCreateKeyFile(string path);

A random key kept in path, created on first use, so identities survive a restart with nothing configured.

RandomKey

public static byte[] RandomKey();

Issue

public string Issue(out string subject);

A new identity: the token to give the client, and the subject it was minted for.

IsAnonymousToken

public static bool IsAnonymousToken(string token);

True when token claims to be one of ours (so it is checked here, not against an OpenID provider).

Verify

public AuthResult Verify(string token);

On this page