> ## Documentation Index
> Fetch the complete documentation index at: https://translations.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> アプリケーションの要件に合わせて Auth0.Android を設定する方法

# Auth0.Android の設定オプション

Auth0.Android は、以下のさまざまなオプションで設定できます。

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  以下のオプションは、以前の V1 リリースから変更されています。詳細については、移行ガイドを参照してください。
</Callout>

<div id="withconnection">
  ## withConnection
</div>

`withConnection` オプションを使用すると、認証に使用する接続を指定できます。

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

<div id="withscope">
  ## withScope
</div>

スコープを使用すると、リクエスト内の特定のフィールドに対応する特定のクレームを返すことができます。`withScope` にパラメーターを追加すると、さらにスコープを追加できます。詳しくは [Scopes](/ja/docs/get-started/apis/scopes) を参照してください。

```kotlin lines theme={null}
WebAuthProvider.login(account)
                .withScope("openid profile email")
                .start(this, callback)
```

デフォルトのスコープは `openid profile email` です。

<div id="withconnectionscope">
  ## withConnectionScope
</div>

特定の認証プロバイダーから、特定の接続スコープや権限を指定して認証する必要がある場合があります。[外部 IdP のスコープを追加する](/ja/docs/authenticate/identity-providers/adding-scopes-for-an-external-idp)を参照してください。ただし、アプリ内の特定の状況で特定のアクセス権が必要な場合は、`withConnectionScope` にパラメーターを渡すこともできます。利用可能なパラメーターの一覧は、[Dashboard](https://manage.auth0.com/#) の該当する接続の設定、または認証プロバイダーのドキュメントで確認できます。ここで要求するスコープは、Dashboard のその接続の設定で指定されているスコープに追加されます。

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

<div id="withparameters">
  ## withParameters
</div>

認証時に追加のパラメーターを送信するには、`withParameters.` を使用します。

```kotlin lines theme={null}
val parameters = mapOf("param1" to "value1")

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

<div id="withheaders">
  ## withHeaders
</div>

認可エンドポイントにカスタムヘッダーを送信するには、`withHeaders.` を使用します。

```kotlin lines theme={null}
val headers = mapOf("header1" to "value1")

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

<div id="withscheme">
  ## withScheme
</div>

Android の "App Links" を使用していない場合、またはリダイレクト URI に別のスキームを使用する場合は、`withScheme` を使用します。選択したスキームに合わせて、`app/build.gradle` ファイル内の `auth0Scheme` Manifest Placeholder と、アプリケーション設定の [Dashboard](https://manage.auth0.com/#) にある AllowList **Allowed Callback URLs** を更新します。

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

<Warning>
  スキームは小文字にする必要があり、アンダースコア文字は使用できません。
</Warning>

<div id="withaudience">
  ## withAudience
</div>

<Tooltip tip="対象者: 発行されたトークンの対象者を一意に識別する値です。トークン内では aud という名前で表され、その値には、IDトークンの場合はアプリケーション（クライアントID）の ID、アクセストークンの場合は API（API Identifier）の ID が含まれます。" cta="用語集を見る" href="/ja/docs/glossary?term=audience">オーディエンス</Tooltip>を指定するには、`withAudience` を使用します。

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