Libraries
    Preparing search index...

    Interface AuthenticationScheme<T>

    An authentication scheme extracts and validates credentials from the transport-agnostic AuthenticationContext.

    interface AuthenticationScheme<T = unknown> {
        name: string;
        authenticate(
            context: AuthenticationContext,
        ): Promise<AuthenticationResult<T>>;
        challenge?(): { headerName: string; headerValue: string };
    }

    Type Parameters

    • T = unknown
    Index

    Properties

    Methods

    Properties

    name: string

    Unique name for this scheme (e.g. "jwt", "cookie").

    Methods

    • Optional challenge header for 401 responses. E.g. { headerName: 'WWW-Authenticate', headerValue: 'Bearer' }

      Returns { headerName: string; headerValue: string }