Auth0Client class

Constructors

Auth0Client({required String clientId, required String domain, required String accessToken, required Duration connectTimeout, required Duration sendTimeout, required Duration receiveTimeout, bool useLoggerInterceptor = false})

Properties

clientId String
final
connectTimeout Duration
final
domain String
final
hashCode int
The hash code for this object.
no setterinherited
receiveTimeout Duration
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sendTimeout Duration
final
useLoggerInterceptor bool
final

Methods

authorizeUrl(dynamic params) String
Builds the full authorize endpoint url in the Authorization Server (AS) with given parameters. parameters params to send to /authorize @param String params.responseType type of the response to get from /authorize. @param String params.redirectUri where the AS will redirect back after success or failure. @param String params.state random string to prevent CSRF attacks. @returns String authorize url with specified params to redirect to for AuthZ/AuthN. ref link: https://auth0.com/docs/api/authentication#authorize-client
createUser(dynamic params, {dynamic isEmail = true}) Future
Performs creating user with specified values @param Object params create user params @param String params.email user's email @param String - params.username user's username @param String params.password user's password @param String params.connection name of the database connection where to create the user @param String - params.metadata additional user information that will be stored in user_metadata @returns Future
exchange(dynamic params) Future
Exchanges a code obtained via /authorize (w/PKCE) for the user's tokens params used to obtain tokens from a code @param String params.code code returned by /authorize. @param String params.redirectUri original redirectUri used when calling /authorize. @param String params.verifier value used to generate the code challenge sent to /authorize. @returns a Future with userInfo ref link: https://auth0.com/docs/api-auth/grant/authorization-code-pkce
exchangeAppleAuthCode({required String subjectToken, required String scope}) Future<Auth0User>
Exchanges a code obtained from SignIn-with-Apple social login for the user's tokens @param subjectToken the auth code token issued by Sign-in-with-Apple service @param scope the scopes requested for the issued tokens. e.g. openid profile @returns a Future with userInfo ref link: https://auth0.com/docs/api-auth/grant/authorization-code-pkce
getUserInfo() Future
Return user information using an access token Param String token user's access token Returns Future with user info
logout() Future
Makes logout API call @returns a Future ref link: https://auth0.com/docs/api/authentication#logout
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
passwordGrant(Map<String, String> params, String clientSecret) Future<Auth0User>
Performs Auth with user credentials using the Password Realm Grant clientSecret is a secret key from auth0 account. params to send realm parameters @param String params.username user's username or email @param String params.password user's password @param String params.realm name of the Realm where to Auth (or connection name) @param String - params.audience identifier of Resource Server (RS) to be included as audience (aud claim) of the issued access token @param String - params.scope scopes requested for the issued tokens. e.g. openid profile @returns a Future with Auth0User ref link: https://auth0.com/docs/api-auth/grant/password#realm-support
passwordRealm(dynamic params) Future<Auth0User>
Performs Auth with user credentials using the Password Realm Grant params to send realm parameters @param String params.username user's username or email @param String params.password user's password @param String params.realm name of the Realm where to Auth (or connection name) @param String - params.audience identifier of Resource Server (RS) to be included as audience (aud claim) of the issued access token @param String - params.scope scopes requested for the issued tokens. e.g. openid profile @returns a Future with Auth0User ref link: https://auth0.com/docs/api-auth/grant/password#realm-support
refreshToken(dynamic params) Future
Obtain new tokens using the Refresh Token obtained during Auth (requesting offline_access scope) @param Object params refresh token params @param String params.refreshToken user's issued refresh token @param String - params.scope scopes requested for the issued tokens. e.g. openid profile @returns Future ref link: https://auth0.com/docs/tokens/refresh-token/current#use-a-refresh-token
resetPassword(dynamic params) Future
Request an email with instructions to change password of a user @param Object parameters reset password parameters @param String parameters.email user's email @param String parameters.connection name of the connection of the user @returns Future
revoke(dynamic params) Future
Revoke an issued refresh token @param Object params revoke token params @param String params.refreshToken user's issued refresh token @returns Future
sendOtpCode(dynamic params, [String? connectionType, String? send]) Future<bool>
Performs sending sms code on phone number params to send parameters connectionType connection type to use, possible values: "sms", "email", defaults to sms connectionType send code type to use, possible: "code", "link", defaults to code @param String params.phone_number user's phone number (if using phone) @param String params.email user's email address (is using email) @returns a Future with bool
toString() String
A string representation of this object.
inherited
updateToken(String newAccessToken) → void
Updates current access token for Auth0 connection
verifyOTP(dynamic params, [String? realm]) Future<Auth0User>
Performs verification of phone number params to send parameters realm realm for authentication, possible values: "sms", "email", defaults to sms @param String params.otp - code form sms/email @param String params.username - users phone is sms realm or email, if email realm is being used @returns a Future with Auth0User

Operators

operator ==(Object other) bool
The equality operator.
inherited