> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-docs-event-stream-action-templates.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> How to configure Auth0.Android to meet your application's needs

# Auth0.Android Configuration Options

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

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  The options below have changed from the previous V1 release. Please see the migration guide for more details.
</Callout>

## withConnection

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

```kotlin lines theme={null}
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](/docs/get-started/apis/scopes) for details.

```kotlin lines theme={null}
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](/docs/authenticate/identity-providers/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](https://manage.auth0.com/#), 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.

```kotlin lines theme={null}
WebAuthProvider.login(account)
                .withConnectionScope("email", "profile", "calendar:read")
                .start(this, callback)
```

## withParameters

To send additional parameters on the authentication, use `withParameters.`

```kotlin lines theme={null}
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.`

```kotlin lines theme={null}
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](https://manage.auth0.com/#) in the Application's settings to match the chosen scheme.

```kotlin lines theme={null}
WebAuthProvider.login(account)
                .withScheme("myapp")
                .start(this, callback)
```

<Warning>
  The scheme must be lowercase and not contain underscore characters.
</Warning>

## withAudience

To provide an <Tooltip tip="Audience: Unique identifier of the audience for an issued token. Named aud in a token, its value contains the ID of either an application (Client ID) for an ID Token or an API (API Identifier) for an Access Token." cta="View Glossary" href="/docs/glossary?term=audience">audience</Tooltip>, use `withAudience`.

```kotlin lines theme={null}
WebAuthProvider.login(account)
                .withAudience("https://YOUR_DOMAIN/userinfo")
                .start(this, callback)
```
