> ## 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.

> グラントタイプと、それらがアプリケーションにどのように関連するかを説明します。

# アプリケーションのグラントタイプ

アプリケーションのグラントタイプ (またはフロー) は、アプリケーションが[アクセストークン](/ja/docs/secure/tokens/access-tokens)を取得する方法であり、認証情報を公開することなく、別のエンティティにリソースへの限定的なアクセスを付与するための仕組みです。[OAuth 2.0 プロトコル](/ja/docs/get-started/authentication-and-authorization-flow/which-oauth-2-0-flow-should-i-use) は複数のグラントタイプをサポートしており、それぞれ異なる種類のアクセスを可能にします。

アプリケーションの要件によっては、他よりも適したグラントタイプがあります。Auth0 にはさまざまな認証フローと <Tooltip tip="Authorization Flow: OAuth 2.0 フレームワークで規定される認可グラント（またはワークフロー）。" cta="用語集を見る" href="/ja/docs/glossary?term=authorization+flows">認可フロー</Tooltip> があり、アプリケーションの `grant_types` プロパティに基づいて、どのグラントタイプが適切かを指定できます。

たとえば、モバイルアプリケーションを保護する場合は、[Authorization Code Flow with Proof Key for Code Exchange (PKCE)](/ja/docs/get-started/authentication-and-authorization-flow/authorization-code-flow-with-pkce) が最も適しています。

一方、シングルページアプリケーション (SPA) などのクライアントサイドアプリケーションを保護し、サーバー間でトークンをやり取りしない場合は、[Form Post を使用した Implicit Flow](/ja/docs/get-started/authentication-and-authorization-flow/implicit-flow-with-form-post) が最も適しています。

アプリケーションの登録時に使用できるグラントタイプはいくつかあります。これらは、次のカテゴリに分けられます。

* **仕様準拠グラント**: <Tooltip tip="OpenID: アプリケーションがログイン情報を収集および保存することなく、ユーザーのアイデンティティを検証できる認証のオープン標準。" cta="用語集を見る" href="/ja/docs/glossary?term=OpenID">OpenID</Tooltip> Connect (OIDC) など、外部仕様で定義され、それに準拠するグラント。
* **Auth0 拡張グラント**: 追加のクライアントをサポートしたり、<Tooltip tip="OAuth 2.0: 認可プロトコルとワークフローを定義する認可フレームワーク。" cta="用語集を見る" href="/ja/docs/glossary?term=OAuth">OAuth</Tooltip> と他の信頼フレームワークとの橋渡しをしたりするために、[OAuth 拡張メカニズム](https://tools.ietf.org/html/rfc6749#section-4.5)に準拠した Auth0 固有のグラント。
* **Auth0 レガシーグラント**: レガシー顧客のみが利用できる従来のグラントタイプです。レガシー顧客の場合は、より安全な代替手段に移行することを強く推奨します。

<div id="available-grant-types">
  ## 利用可能なグラントタイプ
</div>

<div id="specification-conforming-grants">
  ### 仕様に準拠したグラント
</div>

| グラントタイプ                                        | 説明                                                                                                           |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `implicit`                                     | [インプリシットグラント](/ja/docs/get-started/authentication-and-authorization-flow/implicit-flow-with-form-post)       |
| `authorization_code`                           | [認可コードグラント](/ja/docs/get-started/authentication-and-authorization-flow/authorization-code-flow)              |
| `client_credentials`                           | [クライアントクレデンシャルグラント](/ja/docs/get-started/authentication-and-authorization-flow/client-credentials-flow)      |
| `password`                                     | [リソースオーナーパスワードグラント](/ja/docs/get-started/authentication-and-authorization-flow/resource-owner-password-flow) |
| `refresh_token`                                | [リフレッシュトークンを使用する](/ja/docs/secure/tokens/refresh-tokens/use-refresh-tokens)                                  |
| `urn:ietf:params:oauth:grant-type:device_code` | [デバイス認可グラント](/ja/docs/get-started/authentication-and-authorization-flow/device-authorization-flow)           |

<div id="auth0-extension-grants">
  ### Auth0 拡張グラント
</div>

| **グラントタイプ**                                               | **説明**                                           |
| --------------------------------------------------------- | ------------------------------------------------ |
| **`http://auth0.com/oauth/grant-type/password-realm`**    | 特定のレルムを指定できる、リソースオーナーパスワードグラント に類似した拡張グラントを使用します |
| **`http://auth0.com/oauth/grant-type/mfa-oob`**           | 多要素認証 OOB グラントリクエスト                              |
| **`http://auth0.com/oauth/grant-type/mfa-otp`**           | 多要素認証 OTP グラントリクエスト                              |
| **`http://auth0.com/oauth/grant-type/mfa-recovery-code`** | 多要素認証のリカバリーコード用グラントリクエスト                         |
| **`http://auth0.com/oauth/grant-type/passwordless/otp`**  | 埋め込み型パスワードレスログインのグラントリクエスト                       |

<div id="auth0-legacy-grants">
  ### Auth0 レガシーグラント
</div>

レガシーグラントには、次のものがあります。

* `http://auth0.com/oauth/legacy/grant-type/ro`
* `http://auth0.com/oauth/legacy/grant-type/ro/jwt-bearer`
* `http://auth0.com/oauth/legacy/grant-type/delegation/refresh_token`
* `http://auth0.com/oauth/legacy/grant-type/delegation/id_token`
* `http://auth0.com/oauth/legacy/grant-type/access_token`

レガシーグラントタイプは、従来のグラントタイプであり、レガシー顧客のみがサポート対象です。レガシー顧客の場合は、より安全な代替手段への移行を強く推奨します。

2017 年 6 月 8 日以降、すべてのアプリケーションには、必ず設定する必要がある `grant_types` プロパティが追加されました。当時の Auth0 顧客の機能に変更が生じないようにするため、既存のすべてのアプリケーションの `grant_types` プロパティには、Auth0 のすべてのレガシーグラントタイプ、Auth0 拡張機能のグラントタイプ、および仕様準拠のグラントタイプが設定されました。

この時点で、新規の Auth0 顧客はアプリケーションにレガシーグラントタイプを追加できなくなりました。レガシーグラントタイプは、破壊的変更を避けながら新しいフローへ移行できるよう、既存顧客にのみ提供されています。2017 年 6 月 8 日より前から顧客である場合は、<Tooltip tip="Auth0 Dashboard: サービスを設定するための Auth0 の主要製品です。" cta="用語集を表示" href="/ja/docs/glossary?term=Auth0+Dashboard">Auth0 Dashboard</Tooltip> または Auth0 の <Tooltip tip="Auth0 Dashboard: サービスを設定するための Auth0 の主要製品です。" cta="用語集を表示" href="/ja/docs/glossary?term=Management+API">Management API</Tooltip> を使用して、[レガシーグラントタイプを有効化](/ja/docs/get-started/applications/update-grant-types)できます。

現在レガシーグラントタイプを使用している場合は、代わりに使用すべき安全な代替手段を以下の表で確認してください。たとえば、<Tooltip tip="Passwordless: 第 1 認証要素としてパスワードに依存しない認証の形式です。" cta="用語集を表示" href="/ja/docs/glossary?term=Passwordless">パスワードレス</Tooltip>認証を実装している場合は、

`oauth/ro` エンドポイントではなく、[Universal Login](/ja/docs/authenticate/login/auth0-universal-login) を使用してください。

<div id="grant-type-mapping">
  ## グラントタイプのマッピング
</div>

アプリケーションは登録時に、その種類、つまり機密アプリケーションかパブリックアプリケーションかに応じて、利用できるグラントタイプが異なります。さらに、信頼されたファーストパーティアプリケーションでは、追加のグラントタイプも利用できます。

<div id="public-applications">
  ### パブリックアプリケーション
</div>

Native Application またはシングルページアプリケーション (SPA) を Dashboard に登録すると、自動的にパブリックアプリケーションとして扱われます。これは、`token_endpoint_auth_method` フラグが `none` に設定されていることを示します。デフォルトでは、Auth0 は次の `grant_types` を有効にした状態でパブリックアプリケーションを作成します。

* `implicit`
* `authorization_code`
* `refresh_token`

Native Apps では、`device_code` グラントタイプも使用できます。

パブリックアプリケーションでは、`client_credentials` グラントタイプは使用できません。このグラントタイプを使用するには、アプリケーションをパブリックではなく機密アプリケーションとして設定する必要があります。Auth0 Management API の [クライアントを更新](https://auth0.com/docs/api/management/v2#!/Clients/patch_clients_by_id) エンドポイントを使用して、`token_endpoint_auth_method` を `client_secret_post,` `client_secret_basic`、または `private_key_jwt` に設定してください。詳細については、[アプリケーション認証情報](/ja/docs/secure/application-credentials) を参照してください。

<div id="confidential-applications">
  ### 機密アプリケーション
</div>

Regular Web Application またはマシン間 (M2M) Application を Auth0 Dashboard に登録すると、自動的に機密アプリケーションとしてマークされます。これは、`token_endpoint_auth_method` フラグが `none` 以外に設定されていることによって示されます。デフォルトでは、Auth0 は次の `grant_types` が有効な機密アプリケーションを作成します。

* `implicit`
* `authorization_code`
* `refresh_token`
* `client_credentials`

<div id="trusted-first-party-applications">
  ### 信頼できるファーストパーティアプリケーション
</div>

信頼できるファーストパーティアプリケーションでは、機密アプリケーションと同じ `grant_types` に加えて、次のものも有効です。

* `password`
* `http://auth0.com/oauth/grant-type/password-realm`
* `http://auth0.com/oauth/grant-type/mfa-oob`
* `http://auth0.com/oauth/grant-type/mfa-otp`
* `http://auth0.com/oauth/grant-type/mfa-recovery-code`

Dashboard を使用してこれらのグラントタイプを有効または無効にする場合は、アプリケーションに `Password` または `MFA` グラントタイプを追加すると、すべての Password および <Tooltip tip="多要素認証（MFA）: SMS で送信される code など、username と password に加えて別の認証要素を使用するユーザー認証プロセス。" cta="用語集を表示" href="/ja/docs/glossary?term=MFA">MFA</Tooltip> グラントタイプが有効になる点に注意してください。これらを個別に選択することはできません。

<div id="third-party-application-restrictions">
  ## サードパーティアプリケーションの制限
</div>

[サードパーティアプリケーション](/ja/docs/get-started/applications/third-party-applications) では、[OAuth 2.1 のベストプラクティス](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1) に沿った一部のグラントタイプのみをサポートしています。

| **グラントタイプ**                                    | **サードパーティアプリケーションで利用可能** |
| ---------------------------------------------- | ------------------------ |
| `authorization_code`                           | はい (PKCE 必須)             |
| `refresh_token`                                | はい                       |
| `client_credentials`                           | はい (機密クライアントのみ)          |
| `implicit`                                     | いいえ                      |
| `password`                                     | いいえ                      |
| `urn:ietf:params:oauth:grant-type:device_code` | いいえ                      |
| MFA グラント                                       | いいえ                      |
| レガシーグラント                                       | いいえ                      |

詳細については、[サードパーティアプリケーションのセキュリティ制御](/ja/docs/get-started/applications/third-party-applications/security-controls) を参照してください。

<div id="learn-more">
  ## 詳しくはこちら
</div>

* [コンフィデンシャルアプリケーションとパブリックアプリケーション](/ja/docs/get-started/applications/confidential-and-public-applications)
* [サードパーティアプリケーション](/ja/docs/get-started/applications/third-party-applications)
* [ファーストパーティアプリケーションとサードパーティアプリケーション](/ja/docs/get-started/applications/first-party-and-third-party-applications)
* [サブドメイン URL のプレースホルダー](/ja/docs/get-started/applications/wildcards-for-subdomains)
