Skip to main content

Authentication API

A token is a piece of data that has no meaning or use on its own, but combined with the correct tokenization system, becomes a vital player in securing your application. Token based authentication works by ensuring that each request to a server is accompanied by a signed token which the server verifies for authenticity and only then responds to the request.

JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained method for securely transmitting information between parties encoded as a JSON object.

The Authentication API enables you to manage all aspects of user identity when you use Auth0. It offers endpoints so your users can log in, sign up, log out, access APIs, and more.

note

Your access-token contains many privileges, keep it secure!

Web Signin API to authenticate with username and password

More about Authentication API documentation

API


Login

Login to receive token with username and password.

Parameters

POST

/v1/iam/auth/sign-in/web/sign-in

Responses
  • 200 AuthenticationResultType — on success, or the same type with only isMFAEnabled populated if the user must complete an MFA challenge.

Signin with OTP

Sends an OTP to the given phone number to initiate a mobile sign-in.

Parameters

POST

/v1/iam/auth/sign-in/mobile

Responses
  • 200 string

Verify OTP

Verifies the OTP sent to the phone number and completes mobile sign-in.

Parameters

POST

/v1/iam/auth/sign-in/mobile/verify

Responses

Send MFA OTP via Email

Sends an MFA one-time-password to the user's email.

Parameters

POST

/v1/iam/auth/sign-in/send-otp-mail

Responses
  • 200 OK

MFA Signin

Completes sign-in using username, password and an MFA code.

Parameters

POST

/v1/iam/auth/sign-in/web/mfa-signin

Responses

Get MFA Status

Retrieves whether MFA is enabled for the signed-in user. Requires a valid x-access-token.

POST

/v1/iam/auth/sign-in/web/mfa-status

Responses

Create MFA Secret

Creates a new MFA secret/QR code for the signed-in user. Requires a valid x-access-token.

POST

/v1/iam/auth/sign-in/web/mfa

Responses

Disable MFA

Disables MFA for the signed-in user. Requires a valid x-access-token.

Parameters

DELETE

/v1/iam/auth/sign-in/web/mfa

Responses

Enable MFA

Enables MFA for the signed-in user. Requires a valid x-access-token.

Parameters

POST

/v1/iam/auth/sign-in/web/mfa-enable

Responses

Login Status

Validates the given access token and returns the current authentication details.

GET

/v1/iam/auth/sign-in/login/status

Responses

Workday Signin

Signs a user in using a Workday authorization code.

Parameters

POST

/v1/iam/auth/sign-in/web/workday-signin

Responses

OIDC Signin

Signs a user in using OIDC credentials.

Parameters

POST

/v1/iam/auth/sign-in/web/oidc-signin

Responses

Clerk Signin

Signs a user in using a Clerk bearer token, supplied via the Authorization: Bearer <token> header.

Parameters

  • inviteCode string (query, optional)

POST

/v1/iam/auth/sign-in/web/clerk-signin

Responses

Models


WebSignInRequest Object

AttributeTypeDescription
userNamestringUsername
passwordstringUser password
isMobilebooleanIs Mobile sign in
inviteCodestringInvitation Code
refererstringReferer URL

AuthenticationResultType

AttributeTypeDescription
accessTokenstring
refreshTokenstring
idTokenstring
expiresIninteger
tokenTypestring
emailVerifiedboolean
isTrialUserboolean
isMFAEnabledboolean
guidstring

OtpRequest Object

AttributeTypeDescription
phoneNumberstringPhone Number

OtpVerificationRequest Object

AttributeTypeDescription
phoneNumberstringPhone number
verificationCodestringVerification code received on contact no
sessionstringSession token received on signup

MFAEmailRequest Object

AttributeTypeDescription
emailstringEmail address
verificationTokenstringVerification token

MFASigninRequest Object

AttributeTypeDescription
userNamestringUsername
passwordstringUser password
isMobilebooleanIs Mobile sign in
inviteCodestringInvitation Code
mfaCodestringMFA Code

MFADisableRequest Object

AttributeTypeDescription
passwordstringUser password

MFAEnableRequest Object

AttributeTypeDescription
mfaCodestringMFA code
mfaTypeenumMfa type
Example: "EIGHT_DIGIT"

MFAResponse Object

AttributeTypeDescription
enableStatusbooleanMFA Enable Status
keystringMFA Key
qrCodeBytesstringMFA QR Code bytes in base64

MFAEnableResponse Object

AttributeTypeDescription
enableStatusbooleanMFA Enable Status
recoveryCodeslistMFA Recovery codes

MFAStatusResponse Object

AttributeTypeDescription
enableStatusbooleanMFA Enable Status

WorkdaySigninRequest Object

AttributeTypeDescription
codestringCode from Workday

OIDCSigninRequest Object

AttributeTypeDescription
emailstringOIDC user email
accessTokenstringOIDC Access token