AuthScheme

View Source

Summary

Authentication scheme contract consumed by auth().

Signature

interface AuthScheme<identity> {
  name: string;
  authenticate(
    context: RequestContext,
  ):
    | AuthSchemeAuthenticateResult<identity>
    | Promise<AuthSchemeAuthenticateResult<identity>>;
}

Properties

name

Stable method name exposed on the resolved auth state.

Methods

authenticate(context: RequestContext): AuthSchemeAuthenticateResult | Promise<AuthSchemeAuthenticateResult>

Authenticates the current request or returns null/undefined to skip the scheme.

context