Table of Contents

Interface IAuthenticationApiClient

Namespace
Auth0.AuthenticationApi
Assembly
Auth0.AuthenticationApi.dll

Client for communicating with the Auth0 Authentication API.

public interface IAuthenticationApiClient : IDisposable
Inherited Members
Extension Methods

Remarks

Full documentation for the Authentication API is available at https://auth0.com/docs/auth-api

Properties

BaseUri

Base URI that will be used for all the requests.

Uri BaseUri { get; }

Property Value

Uri

Methods

AssociateMfaAuthenticatorAsync(AssociateMfaAuthenticatorRequest, CancellationToken)

Associates or adds a new authenticator for Multi-Factor authentication (MFA).

Task<AssociateMfaAuthenticatorResponse> AssociateMfaAuthenticatorAsync(AssociateMfaAuthenticatorRequest request, CancellationToken cancellationToken = default)

Parameters

request AssociateMfaAuthenticatorRequest

AssociateMfaAuthenticatorRequest containing information to enroll a new Authenticator.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<AssociateMfaAuthenticatorResponse>

A AssociateMfaAuthenticatorResponse with the details of the response.

ChangePasswordAsync(ChangePasswordRequest, CancellationToken)

Requests a password change email for a given email address and connection.

Task<string> ChangePasswordAsync(ChangePasswordRequest request, CancellationToken cancellationToken = default)

Parameters

request ChangePasswordRequest

ChangePasswordRequest specifying the user, connection and optional client details.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<string>

Task representing the async operation containing either the JSON error response or the plain text success message response.

ClientInitiatedBackchannelAuthorization(ClientInitiatedBackchannelAuthorizationRequest, CancellationToken)

Initiates a Client Initiated Backchannel Authorization flow.

Task<ClientInitiatedBackchannelAuthorizationResponse> ClientInitiatedBackchannelAuthorization(ClientInitiatedBackchannelAuthorizationRequest request, CancellationToken cancellationToken = default)

Parameters

request ClientInitiatedBackchannelAuthorizationRequest

ClientInitiatedBackchannelAuthorizationRequest

cancellationToken CancellationToken

Returns

Task<ClientInitiatedBackchannelAuthorizationResponse>

Task representing the async operation containing a ClientInitiatedBackchannelAuthorizationResponse with the details of the response.

DeleteMfaAuthenticatorAsync(DeleteMfaAuthenticatorRequest, CancellationToken)

Deletes an associated authenticator using its ID.

Task DeleteMfaAuthenticatorAsync(DeleteMfaAuthenticatorRequest request, CancellationToken cancellationToken = default)

Parameters

request DeleteMfaAuthenticatorRequest

DeleteMfaAuthenticatorRequest containing information to delete an associated authenticator

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task

GetImpersonationUrlAsync(ImpersonationRequest, CancellationToken)

Obtains a one-time link that can be used to log in as a specific user.

Task<Uri> GetImpersonationUrlAsync(ImpersonationRequest request, CancellationToken cancellationToken = default)

Parameters

request ImpersonationRequest

The ImpersonationRequest containing the details of the user to impersonate.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Uri>

Task which can be used to sign in as the specified user.

Remarks

This feature has been deprecated and will be removed from Auth0 and this library in a future release.

GetTokenAsync(AuthorizationCodePkceTokenRequest, CancellationToken)

Exchanges an Authorization Code using PKCE for an Access Token.

Task<AccessTokenResponse> GetTokenAsync(AuthorizationCodePkceTokenRequest request, CancellationToken cancellationToken = default)

Parameters

request AuthorizationCodePkceTokenRequest

AuthorizationCodePkceTokenRequest containing Authorization Code and PKCE details.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<AccessTokenResponse>

Task representing the async operation containing a AccessTokenResponse with the requested tokens.

GetTokenAsync(AuthorizationCodeTokenRequest, CancellationToken)

Exchanges an Authorization Code for an Access Token.

Task<AccessTokenResponse> GetTokenAsync(AuthorizationCodeTokenRequest request, CancellationToken cancellationToken = default)

Parameters

request AuthorizationCodeTokenRequest

AuthorizationCodeTokenRequest containing Authorization Code details.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<AccessTokenResponse>

Task representing the async operation containing a AccessTokenResponse with the requested tokens.

GetTokenAsync(ClientInitiatedBackchannelAuthorizationTokenRequest, CancellationToken)

Requests an Access Token using the CIBA flow

Task<ClientInitiatedBackchannelAuthorizationTokenResponse> GetTokenAsync(ClientInitiatedBackchannelAuthorizationTokenRequest request, CancellationToken cancellationToken = default)

Parameters

request ClientInitiatedBackchannelAuthorizationTokenRequest

ClientInitiatedBackchannelAuthorizationTokenRequest

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<ClientInitiatedBackchannelAuthorizationTokenResponse>

Task representing the async operation containing a ClientInitiatedBackchannelAuthorizationTokenResponse with the requested tokens.

Remarks

This must be polled while the user is completing their part of the flow at an interval no more frequent than that returned by ClientInitiatedBackchannelAuthorizationResponse.

GetTokenAsync(ClientCredentialsTokenRequest, CancellationToken)

Requests an Access Token using the Client Credentials Grant flow.

Task<AccessTokenResponse> GetTokenAsync(ClientCredentialsTokenRequest request, CancellationToken cancellationToken = default)

Parameters

request ClientCredentialsTokenRequest

ClientCredentialsTokenRequest containing client and audience details of the request.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<AccessTokenResponse>

Task representing the async operation containing a AccessTokenResponse with the requested tokens.

GetTokenAsync(DeviceCodeTokenRequest, CancellationToken)

Requests an Access Token using the Device Authorization flow

Task<AccessTokenResponse> GetTokenAsync(DeviceCodeTokenRequest request, CancellationToken cancellationToken = default)

Parameters

request DeviceCodeTokenRequest

DeviceCodeTokenRequest containing request details to exchange a device code.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<AccessTokenResponse>

Task representing the async operation containing a AccessTokenResponse with the requested tokens.

Remarks

This must be polled while the user is completing their part of the flow at an interval no more frequent than that returned by StartDeviceFlowAsync(DeviceCodeRequest, CancellationToken).

GetTokenAsync(MfaOobTokenRequest, CancellationToken)

Requests an Access Token using Oob MFA verification.

Task<MfaOobTokenResponse> GetTokenAsync(MfaOobTokenRequest request, CancellationToken cancellationToken = default)

Parameters

request MfaOobTokenRequest

MfaOobTokenRequest containing request details to verify oob.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<MfaOobTokenResponse>

Task representing the async operation containing a MfaOobTokenResponse with the requested tokens.

GetTokenAsync(MfaOtpTokenRequest, CancellationToken)

Requests an Access Token using OTP MFA verification.

Task<MfaOtpTokenResponse> GetTokenAsync(MfaOtpTokenRequest request, CancellationToken cancellationToken = default)

Parameters

request MfaOtpTokenRequest

MfaOtpTokenRequest containing request details to verify otp.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<MfaOtpTokenResponse>

An MfaOtpTokenResponse with the requested tokens.

GetTokenAsync(MfaRecoveryCodeRequest, CancellationToken)

Verifies multi-factor authentication (MFA) using a recovery code.

Task<MfaRecoveryCodeResponse> GetTokenAsync(MfaRecoveryCodeRequest request, CancellationToken cancellationToken = default)

Parameters

request MfaRecoveryCodeRequest

MfaRecoveryCodeRequest containing request details to verify recovery code.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<MfaRecoveryCodeResponse>

An MfaRecoveryCodeResponse with the requested tokens.

GetTokenAsync(PasswordlessEmailTokenRequest, CancellationToken)

Requests an Access Token using the Passwordless flow through email.

Task<AccessTokenResponse> GetTokenAsync(PasswordlessEmailTokenRequest request, CancellationToken cancellationToken = default)

Parameters

request PasswordlessEmailTokenRequest

PasswordlessEmailTokenRequest containing request details to exchange a one time password received through email.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<AccessTokenResponse>

Task representing the async operation containing a AccessTokenResponse with the requested tokens.

GetTokenAsync(PasswordlessSmsTokenRequest, CancellationToken)

Requests an Access Token using the Passwordless flow through SMS.

Task<AccessTokenResponse> GetTokenAsync(PasswordlessSmsTokenRequest request, CancellationToken cancellationToken = default)

Parameters

request PasswordlessSmsTokenRequest

PasswordlessSmsTokenRequest containing request details to exchange a one time password received through SMS.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<AccessTokenResponse>

Task representing the async operation containing a AccessTokenResponse with the requested tokens.

GetTokenAsync(RefreshTokenRequest, CancellationToken)

Refreshes all tokens by way of the the Refresh Token obtained during authorization.

Task<AccessTokenResponse> GetTokenAsync(RefreshTokenRequest request, CancellationToken cancellationToken = default)

Parameters

request RefreshTokenRequest

RefreshTokenRequest containing Refresh Token and associated parameters.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<AccessTokenResponse>

Task representing the async operation containing a AccessTokenResponse with the requested tokens.

GetTokenAsync(ResourceOwnerTokenRequest, CancellationToken)

Performs authentication by providing user-supplied information in a ResourceOwnerTokenRequest.

Task<AccessTokenResponse> GetTokenAsync(ResourceOwnerTokenRequest request, CancellationToken cancellationToken = default)

Parameters

request ResourceOwnerTokenRequest

ResourceOwnerTokenRequest containing information regarding the username, password etc.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<AccessTokenResponse>

Task representing the async operation containing a AccessTokenResponse with the requested tokens.

Remarks

The grant_type parameter required by the /oauth/token endpoint will automatically be inferred from the request parameter. If no Realm was specified, then the grant_type will be set to "password". If a Realm was specified, then the grant_type will be set to "http://auth0.com/oauth/grant-type/password-realm"

GetUserInfoAsync(string, CancellationToken)

Returns user information based on the access token that was obtained during login.

Task<UserInfo> GetUserInfoAsync(string accessToken, CancellationToken cancellationToken = default)

Parameters

accessToken string

Access token used to obtain the user information.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<UserInfo>

Task representing the async operation containing the UserInfo requested..

Remarks

Information included in the response depends on the scopes initially granted.

ListMfaAuthenticatorsAsync(string, CancellationToken)

List authenticators associated with your application.

Task<IList<Authenticator>> ListMfaAuthenticatorsAsync(string accessToken, CancellationToken cancellationToken = default)

Parameters

accessToken string

Access token with scope: read:authenticators and audience: https://{yourDomain}/mfa/

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<IList<Authenticator>>

List of Authenticator

MfaChallenge(MfaChallengeRequest, CancellationToken)

The Multi-factor Authentication (MFA) API endpoints allow you to enforce MFA when users interact with the Token endpoints, as well as enroll and manage user authenticators.

Task<MfaChallengeResponse> MfaChallenge(MfaChallengeRequest request, CancellationToken cancellationToken = default)

Parameters

request MfaChallengeRequest

MfaChallengeRequest containing request details to challenge.

cancellationToken CancellationToken

The cancellation token to cancel operation

Returns

Task<MfaChallengeResponse>

An MfaRecoveryCodeResponse with the requested tokens

PushedAuthorizationRequestAsync(PushedAuthorizationRequest, CancellationToken)

Starts a new Pushed Authorization Request flow.

Task<PushedAuthorizationRequestResponse> PushedAuthorizationRequestAsync(PushedAuthorizationRequest request, CancellationToken cancellationToken = default)

Parameters

request PushedAuthorizationRequest

PushedAuthorizationRequest containing information to start the Pushed Authorization Request.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<PushedAuthorizationRequestResponse>

Task representing the async operation containing a PushedAuthorizationRequestResponse with the details of the response.

RevokeRefreshTokenAsync(RevokeRefreshTokenRequest, CancellationToken)

Revokes refresh token provided in request.

Task RevokeRefreshTokenAsync(RevokeRefreshTokenRequest request, CancellationToken cancellationToken = default)

Parameters

request RevokeRefreshTokenRequest

RevokeRefreshTokenRequest containing Refresh Token and associated parameters.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task

Task representing the async operation.

SignupUserAsync(SignupUserRequest, CancellationToken)

Creates a new user given the user details specified.

Task<SignupUserResponse> SignupUserAsync(SignupUserRequest request, CancellationToken cancellationToken = default)

Parameters

request SignupUserRequest

SignupUserRequest containing information of the user to sign up.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<SignupUserResponse>

Task representing the async operation containing a SignupUserResponse with the information of the signed up user.

StartDeviceFlowAsync(DeviceCodeRequest, CancellationToken)

Starts a new Device Authorization flow

Task<DeviceCodeResponse> StartDeviceFlowAsync(DeviceCodeRequest request, CancellationToken cancellationToken = default)

Parameters

request DeviceCodeRequest

DeviceCodeRequest containing client, scope and audience

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<DeviceCodeResponse>

Task representing the async operation containing a DeviceCodeResponse with the details of the request.

StartPasswordlessEmailFlowAsync(PasswordlessEmailRequest, CancellationToken)

Starts a new Passwordless email flow.

Task<PasswordlessEmailResponse> StartPasswordlessEmailFlowAsync(PasswordlessEmailRequest request, CancellationToken cancellationToken = default)

Parameters

request PasswordlessEmailRequest

PasswordlessEmailRequest containing details about the Passwordless email flow to start.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<PasswordlessEmailResponse>

Task representing the async operation containing a PasswordlessEmailResponse with the information of the signed up user.

StartPasswordlessSmsFlowAsync(PasswordlessSmsRequest, CancellationToken)

Starts a new Passwordless SMS flow.

Task<PasswordlessSmsResponse> StartPasswordlessSmsFlowAsync(PasswordlessSmsRequest request, CancellationToken cancellationToken = default)

Parameters

request PasswordlessSmsRequest

PasswordlessSmsRequest containing details about the Passwordless SMS flow to start.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<PasswordlessSmsResponse>

Task representing the async operation containing a PasswordlessSmsResponse with the details of the request.