Auth0 Auth Provider

Authenticate using Auth0 OAuth provider.


**Callback or Redirect URL pattern**
tssrc/payload.config.ts
            import { buildConfig } from "payload/config";
import { adminAuthPlugin } from "payload-auth-plugin";
import { Auth0AuthProvider } from "payload-auth-plugin/providers";

export default buildConfig({
  // --- rest of the config
  plugins: [
    // --- rest of the plugins
    adminAuthPlugin({
      providers: [
        Auth0AuthProvider({
          client_id: process.env.PROVIDER_CLIENT_ID as string,
          client_secret: process.env.PROVIDER_CLIENT_SECRET as string,
          domain: process.env.AUTH0_DOMAIN as string,
        }),
      ],
    }),
  ],
});

        

Parameters

config Auth0AuthConfig


Returns

provider OAuth2ProviderConfig


Auth0AuthConfig

Auth0AuthConfig.client_id:

Type: string

Description: client_id is a string generated by Auth0 to identify your Payload app.

Optional: No.

ts
            {
  client_id: "";
}

        

Auth0AuthConfig.client_secret:

Type: string

Description: client_secret is a private key generated by Auth0 to authenticate your Payload app.

Optional: No.

ts
            {
  client_secret: "";
}

        

Auth0AuthConfig.domain:

Type: string

Description: domain of the Auth0 OAuth app, you may also create a custom domain for your Payload app and use that in your Auth0 OAuth app.

Optional: No.

ts
            {
  domain: "";
}

        

Auth0AuthConfig.params:

Type: Record<string, string>

Description: params any additional parameters to pass to the IDP for authorization.

Optional: Yes.

ts
            {
  params: {
    // additional parameters
  }
}