Class ServerAuthenticator
Authenticates the server itself at startup and owns the server's game session ("slot"). In Offline it is a no-op. In Authenticated it obtains an access token (env or OAuth device flow), then acquires a game session. ReleaseAsync(CancellationToken) frees the slot on shutdown so it does not count against the account's session limit.
public sealed class ServerAuthenticator
- Inheritance
-
ServerAuthenticator
- Inherited Members
Constructors
ServerAuthenticator(ServiceHttpClient, AuthConfig, IShardLogger)
Authenticates the server itself at startup and owns the server's game session ("slot"). In Offline it is a no-op. In Authenticated it obtains an access token (env or OAuth device flow), then acquires a game session. ReleaseAsync(CancellationToken) frees the slot on shutdown so it does not count against the account's session limit.
public ServerAuthenticator(ServiceHttpClient http, AuthConfig config, IShardLogger log)
Parameters
httpServiceHttpClientconfigAuthConfiglogIShardLogger
Properties
AccessToken
public string? AccessToken { get; }
Property Value
ServerIdentityToken
The server's identity token (sent to clients in AuthGrant); null until acquired.
public string? ServerIdentityToken { get; }
Property Value
ServerSessionId
Per-boot identifier used as the audience when requesting player auth grants.
public Guid ServerSessionId { get; }
Property Value
SessionToken
The server's game session token while a slot is held; null otherwise.
public string? SessionToken { get; }
Property Value
Methods
AuthenticateAsync(AuthMode, CancellationToken)
public Task AuthenticateAsync(AuthMode mode, CancellationToken ct = default)
Parameters
modeAuthModectCancellationToken
Returns
ReleaseAsync(CancellationToken)
Releases a held game session once and saves OAuth tokens for the next start without the released session. Session release failures are logged. Persistence failures propagate to the caller.
public Task ReleaseAsync(CancellationToken ct = default)