providers/auth0
default()β
Add Auth0 login to your page.
Exampleβ
import { Auth } from "@auth/core";
import Auth0 from "@auth/core/providers/auth0";
const request = new Request("https://example.com");
const response = await Auth(request, {
providers: [Auth0({ clientId: "", clientSecret: "", issuer: "" })],
});
Resourcesβ
Notesβ
By default, Auth.js assumes that the Auth0 provider is based on the OIDC specification.
The Auth0 provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.
If you think you found a bug in the default configuration, you can open an issue.
Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, we might not pursue a resolution. You can ask for more help in Discussions.
default(
config
:OIDCUserConfig
<Auth0Profile
>):OIDCConfig
<Auth0Profile
>
Parametersβ
Parameter | Type |
---|---|
config | OIDCUserConfig <Auth0Profile > |
Returnsβ
Auth0Profileβ
Seeβ
Propertiesβ
app_metadataβ
app_metadata:
object
Custom fields that store info about a user that influences the user's access, such as support plan, security roles (if not using the Authorization Core feature set), or access control groups. To learn more, read Metadata Overview.
blockedβ
blocked:
boolean
Indicates whether the user has been blocked. Importing enables subscribers to ensure that users remain blocked when migrating to Auth0.
created_atβ
created_at:
Date
Timestamp indicating when the user profile was first created.
emailβ
email:
string
(unique) The user's email address.
email_verifiedβ
email_verified:
boolean
Indicates whether the user has verified their email address.
family_nameβ
family_name:
string
The user's family name.
given_nameβ
given_name:
string
The user's given name.
identitiesβ
identities: {
[key: string]
:any
;connection
:string
;isSocial
:boolean
;profileData
:object
;provider
:string
;user_id
:string
;}[]
Contains info retrieved from the identity provider with which the user originally authenticates. Users may also link their profile to multiple identity providers; those identities will then also appear in this array. The contents of an individual identity provider object varies by provider. In some cases, it will also include an API Access Token to be used with the provider.
last_ipβ
last_ip:
string
IP address associated with the user's last login.
last_loginβ
last_login:
Date
Timestamp indicating when the user last logged in. If a user is blocked and logs in, the blocked session updates last_login. If you are using this property from inside a Rule using the user< object, its value will be associated with the login that triggered the rule; this is because rules execute after login.
last_password_resetβ
last_password_reset:
Date
Timestamp indicating the last time the user's password was reset/changed. At user creation, this field does not exist. This property is only available for Database connections.
logins_countβ
logins_count:
number
Number of times the user has logged in. If a user is blocked and logs in, the blocked session is counted in logins_count.
multifactorβ
multifactor:
string
List of multi-factor providers with which the user is enrolled.
nameβ
name:
string
The user's full name.
nicknameβ
nickname:
string
The user's nickname.
phone_numberβ
phone_number:
string
The user's phone number. Only valid for users with SMS connections.
phone_verifiedβ
phone_verified:
boolean
Indicates whether the user has been verified their phone number. Only valid for users with SMS connections.
pictureβ
picture:
string
URL pointing to the user's profile picture.
subβ
sub:
string
The user's unique identifier.
updated_atβ
updated_at:
Date
Timestamp indicating when the user's profile was last updated/modified. Changes to last_login are considered updates, so most of the time, updated_at will match last_login.
user_idβ
user_id:
string
(unique) The user's identifier. Importing allows user records to be synchronized across multiple systems without using mapping tables.
user_metadataβ
user_metadata:
object
Custom fields that store info about a user that does not impact what they can or cannot access, such as work address, home address, or user preferences. To learn more, read Metadata Overview.
usernameβ
username:
string
(unique) The user's username.