middy-middleware-jwt-auth
    Preparing search index...

    Interface IAuthOptions<P>

    Options for the middy-middleware-jwt-auth

    interface IAuthOptions<P = any> {
        algorithm: EncryptionAlgorithms;
        credentialsRequired?: boolean;
        isPayload?: (payload: any) => payload is P;
        secretOrPublicKey:
            | string
            | Buffer<ArrayBufferLike>
            | (
                (
                    header: any,
                    callback: (error: Error | null, key?: string) => void,
                ) => void
            );
        tokenSource?: (event: any) => string | Promise<string>;
    }

    Type Parameters

    • P = any
    Index

    Properties

    Algorithm to verify JSON web token signature

    credentialsRequired?: boolean

    An optional boolean that allows making authorization necessary

    isPayload?: (payload: any) => payload is P

    An optional type guard function that verifies token payload structure

    secretOrPublicKey:
        | string
        | Buffer<ArrayBufferLike>
        | (
            (
                header: any,
                callback: (error: Error | null, key?: string) => void,
            ) => void
        )

    A string or buffer containing either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA

    tokenSource?: (event: any) => string | Promise<string>

    An optional function to get the authorization token from the event