Auth0.Android Configuration Options

Auth0.Android can be configured with a variety of options, listed below.

The options below have changed from the previous V1 release. Please see the migration guide for more details.

withConnection

The withConnection option lets you specify a connection that you want to authenticate with.

WebAuthProvider.login(account)
                .withConnection("twitter")
                .start(this, callback)

withScope

Using scopes can lets you return specific claims for specific fields in your request. Adding parameters to withScope lets you add more scopes. See Scopes for details.

WebAuthProvider.login(account)
                .withScope("openid profile email")
                .start(this, callback)

The default scope is openid profile email.

withConnectionScope

There may be times when you need to authenticate with particular connection scopes, or permissions, from the authentication provider in question. See Adding Scopes for an External IDP. However, if you need specific access for a particular situation in your app, you can do pass parameters to withConnectionScope. You can find a full list of the available parameters in that connection's settings on the Dashboard, or from the authentication providers's documentation. The scope requested here is added on top of the ones specified in the connection's settings in the Dashboard.

WebAuthProvider.login(account)
                .withConnectionScope("email", "profile", "calendar:read")
                .start(this, callback)

withParameters

To send additional parameters on the authentication, use withParameters.

val parameters = mapOf("param1" to "value1")

WebAuthProvider.login(account)
                .withParameters(parameters)
                .start(this, callback)

withHeaders

To send custom headers to the authorization endpoint, use withHeaders.

val headers = mapOf("header1" to "value1")

WebAuthProvider.login(account)
                .withHeaders(headers)
                .start(this, callback)

withScheme

If you are not using Android "App Links" or you want to use a different scheme for the redirect URI, use withScheme. Update the auth0Scheme Manifest Placeholder in the app/build.gradle file and the AllowList Allowed Callback URLs on the Dashboard in the Application's settings to match the chosen scheme.

WebAuthProvider.login(account)
                .withScheme("myapp")
                .start(this, callback)

The scheme must be lowercase and not contain underscore characters.

withAudience

To provide an audience, use withAudience.

WebAuthProvider.login(account)
                .withAudience("https://YOUR_DOMAIN/userinfo")
                .start(this, callback)