Interface IAuth0Client
- Namespace
- Auth0.OidcClient
- Assembly
- Auth0.OidcClient.Core.dll
Interface for performing authentication and authorization operations with Auth0 using the underlying IdentityModel.OidcClient.OidcClient.
public interface IAuth0Client
Methods
GetUserInfoAsync(string)
Gets the user claims from the userinfo endpoint.
Task<UserInfoResult> GetUserInfoAsync(string accessToken)
Parameters
accessTokenstringAccess token to use in obtaining claims.
Returns
- Task<UserInfoResult>
A IdentityModel.OidcClient.Results.UserInfoResult with the user information and claims.
Exceptions
- ArgumentNullException
When
accessTokenis null.- InvalidOperationException
When no userinfo endpoint specified.
LoginAsync(object, CancellationToken)
Launches a browser to log the user in.
Task<LoginResult> LoginAsync(object extraParameters = null, CancellationToken cancellationToken = default)
Parameters
extraParametersobjectOptional extra parameters that need to be passed to the endpoint.
cancellationTokenCancellationTokenOptional CancellationToken that can be used to cancel the request.
Returns
- Task<LoginResult>
A IdentityModel.OidcClient.LoginResult containing the tokens and claims.
LogoutAsync(bool, object, CancellationToken)
Launches a browser to log the user out and clear the Auth0 SSO Cookie.
Task<BrowserResultType> LogoutAsync(bool federated = false, object extraParameters = null, CancellationToken cancellationToken = default)
Parameters
federatedboolWhether to log the user out of their federated identity provider. Defaults to false.
extraParametersobjectOptional extra parameters that need to be passed to the endpoint.
cancellationTokenCancellationTokenOptional CancellationToken that can be used to cancel the request.
Returns
- Task<BrowserResultType>
A IdentityModel.OidcClient.Browser.BrowserResultType indicating whether the logout was successful.
PrepareLoginAsync(object, CancellationToken)
Generates an IdentityModel.OidcClient.AuthorizeState containing the URL, state, nonce and code challenge which can be used to redirect the user to the authorization URL, and subsequently process any response by calling the ProcessResponseAsync(string, AuthorizeState, object, CancellationToken) method.
Task<AuthorizeState> PrepareLoginAsync(object extraParameters = null, CancellationToken cancellationToken = default)
Parameters
extraParametersobjectOptional extra parameters that need to be passed to the endpoint.
cancellationTokenCancellationTokenOptional CancellationToken that can be used to cancel the request.
Returns
- Task<AuthorizeState>
A IdentityModel.OidcClient.AuthorizeState with necessary URLs, nonce, state and code verifiers.
ProcessResponseAsync(string, AuthorizeState, object, CancellationToken)
Process the response from the Auth0 redirect URI.
Task<LoginResult> ProcessResponseAsync(string data, AuthorizeState state, object extraParameters = null, CancellationToken cancellationToken = default)
Parameters
datastringThe data containing the full redirect URI.
stateAuthorizeStateThe IdentityModel.OidcClient.AuthorizeState which was generated when the PrepareLoginAsync(object, CancellationToken) method was called.
extraParametersobjectOptional extra parameters that need to be passed to the endpoint.
cancellationTokenCancellationTokenOptional CancellationToken that can be used to cancel the request.
Returns
- Task<LoginResult>
A IdentityModel.OidcClient.LoginResult containing the tokens and claims.
RefreshTokenAsync(string, object, CancellationToken)
Generates a new set of tokens based on a refresh token.
Task<RefreshTokenResult> RefreshTokenAsync(string refreshToken, object extraParameters = null, CancellationToken cancellationToken = default)
Parameters
refreshTokenstringRefresh token which was issued during the authorization flow, or subsequent calls to RefreshTokenAsync(string, Parameters, string, CancellationToken).
extraParametersobjectOptional extra parameters that need to be passed to the endpoint.
cancellationTokenCancellationTokenOptional CancellationToken that can be used to cancel the request.
Returns
- Task<RefreshTokenResult>
A IdentityModel.OidcClient.Results.RefreshTokenResult with the refreshed tokens.
RefreshTokenAsync(string, string, object, CancellationToken)
Generates a new set of tokens based on a refresh token.
Task<RefreshTokenResult> RefreshTokenAsync(string refreshToken, string scope, object extraParameters = null, CancellationToken cancellationToken = default)
Parameters
refreshTokenstringRefresh token which was issued during the authorization flow, or subsequent calls to RefreshTokenAsync(string, Parameters, string, CancellationToken).
scopestringSpace separated list of the requested scopes.
extraParametersobjectOptional extra parameters that need to be passed to the endpoint.
cancellationTokenCancellationTokenOptional CancellationToken that can be used to cancel the request.
Returns
- Task<RefreshTokenResult>
A IdentityModel.OidcClient.Results.RefreshTokenResult with the refreshed tokens.
RefreshTokenAsync(string, CancellationToken)
Generates a new set of tokens based on a refresh token.
Task<RefreshTokenResult> RefreshTokenAsync(string refreshToken, CancellationToken cancellationToken = default)
Parameters
refreshTokenstringRefresh token which was issued during the authorization flow, or subsequent calls to RefreshTokenAsync(string, Parameters, string, CancellationToken).
cancellationTokenCancellationTokenOptional CancellationToken that can be used to cancel the request.
Returns
- Task<RefreshTokenResult>
A IdentityModel.OidcClient.LoginResult containing the tokens and claims.