interface AuthDefaultAdapterOptions {
    authEncSecret: string;
    authSignSecret: string;
    authType?: AuthType;
    authenticate?: AuthenticationFunction;
    authenticateRefreshToken?: AuthenticationRefreshTokenFunction;
    authorizedRedirectUrls?: string[];
    collectionNames?: AuthDefaultAdapterCollectionNames;
    cookieConfig?: false | CookieConfig;
    enableRefreshToken?: boolean;
    oauthCallbackTokenBehavior?: OauthCallbackTokenBehavior;
    setTwoFactorAuth?: false | {
        codeConfig?: {
            expireTime?: string | number;
            length?: number;
        };
        emailConfig: {
            bodyTemplate: string;
            sender: string;
            subject: string;
        };
    };
    tokenExpireTime?: TokenExpireTime;
}

Properties

authEncSecret: string

Secret use to encrypt the JWT Token

authSignSecret: string

Secret use to sign the JWT Token

authType?: AuthType
authenticate?: AuthenticationFunction

Function that will be called to authenticate the user via validators. When not provided, this will default to the default for the given authType.

Typically you would only provide this if designing your own authentication.

authenticateRefreshToken?: AuthenticationRefreshTokenFunction

Function that will be called to authenticate the a refresh token. When not provided, this will default to the default for the given authType.

This is also used to fetch the refresh token without authentication when decryptToken is false.

Typically you would only provide this if designing your own authentication.

authorizedRedirectUrls?: string[]

The allowed authorized redirect urls for social login

Collection name configuration for auth data services

cookieConfig?: false | CookieConfig

If authType === 'cookie', configures how the cookie is set up

enableRefreshToken?: boolean

If enable the refresh token feature

oauthCallbackTokenBehavior?: OauthCallbackTokenBehavior

OAuth callback token behavior

setTwoFactorAuth?: false | {
    codeConfig?: {
        expireTime?: string | number;
        length?: number;
    };
    emailConfig: {
        bodyTemplate: string;
        sender: string;
        subject: string;
    };
}

The configuration for two factor auth

Type declaration

  • Optional codeConfig?: {
        expireTime?: string | number;
        length?: number;
    }

    The configuration for the code of 2FA

    • Optional expireTime?: string | number

      (Optional) the expire time of the validation

    • Optional length?: number

      Length of code

  • emailConfig: {
        bodyTemplate: string;
        sender: string;
        subject: string;
    }

    The configuration for the email of 2FA

    • bodyTemplate: string

      The Email body template

    • sender: string

      The Email sender template

    • subject: string

      The Email subject template

tokenExpireTime?: TokenExpireTime

(Optional) The expiration time of the JWT Token

Generated using TypeDoc