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

# アプリケーションの認可

> OAuth 2.0 の Authorization Code Flow を開始し、ユーザーの同意と認可コードを取得します。

<div id="endpoint">
  ## エンドポイント
</div>

`GET /authorize`

OAuth 2.0 の認可フローを開始するには、まずアプリケーションからユーザーを認可 URL にリダイレクトする必要があります。

<div id="authorize-endpoint">
  ## Authorize エンドポイント
</div>

この呼び出しの目的は、API (`audience` で指定) を呼び出し、ユーザーに代わって特定の操作 (`scope` で指定) を実行することについて、ユーザーの同意を得ることです。Auth0 はユーザーを認証し、事前に同意が付与されていない限り、同意を取得します。`scope` の値を変更すると、Auth0 は再度同意を求めます。

ユーザーによる認可が必要な OAuth 2.0 フローは次のとおりです。

* [Authorization Code Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow)
* [Authorization Code Flow with Proof Key for Code Exchange (PKCE)](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow-with-pkce)
* [Implicit Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/implicit-flow-with-form-post)

[Resource Owner Password Grant](https://auth0.com/docs/get-started/authentication-and-authorization-flow/resource-owner-password-flow) と [Client Credentials フロー](https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow) では、ユーザーによる認可が伴わないため、このエンドポイントは使用しません。代わりに、`POST /oauth/token` エンドポイントを直接呼び出してアクセストークンを取得します。

実装する OAuth 2.0 フローに応じて、パラメーターは若干異なります。どのフローがユースケースに最適かを判断するには、[どの OAuth 2.0 フローを使用すべきですか？](https://auth0.com/docs/get-started/authentication-and-authorization-flow/which-oauth-2-0-flow-should-i-use) を参照してください。

<div id="query-parameters">
  ## クエリーパラメーター
</div>

<ParamField query="audience" type="string" required>
  アクセスする対象 API の一意の識別子。
</ParamField>

<ParamField query="resource" type="string">
  アクセスする対象 API (リソースサーバー) の識別子。Auth0 テナントに登録されている API 識別子と一致している必要があります。テナントの[リソースパラメーター互換性プロファイル](https://auth0.com/docs/get-started/tenant-settings#settings-advanced)が`compatibility`に設定されている場合は、`audience`の代わりに使用されます。
</ParamField>

<ParamField query="scope" type="string">
  認可をリクエストするスコープ。スペース区切りで指定する必要があります。標準の OpenID Connect (OIDC) スコープ、カスタムクレーム、または対象 API でサポートされている任意のスコープをリクエストできます。リフレッシュトークンを取得するには、`offline_access`を含めます。
</ParamField>

<ParamField query="response_type" type="string" required>
  実行する OAuth 2.0 フローを Auth0 に指定します。認可コードグラントフローには 'code' を使用します。
</ParamField>

<ParamField query="client_id" type="string" required>
  アプリケーションの ID。
</ParamField>

<ParamField query="redirect_uri" type="string">
  ユーザーが認可を付与した後に、Auth0 がブラウザーをリダイレクトする URL。
</ParamField>

<ParamField query="state" type="string">
  アプリケーションが最初のリクエストに追加し、Auth0 がアプリケーションにリダイレクトするときに含める不透明な値。この値は、CSRF 攻撃を防ぐためにアプリケーションで使用する必要があります。
</ParamField>

<ParamField query="connection" type="string">
  アプリケーション用に設定された接続の名前。
</ParamField>

<ParamField query="prompt" type="string">
  [サイレント認証](https://auth0.com/docs/authenticate/login/configure-silent-authentication)リクエストを開始するには、'prompt=none' を使用します。
</ParamField>

<ParamField query="organization" type="string">
  ユーザーの認証時に使用する組織の ID。指定しない場合、アプリケーションで **組織プロンプトを表示** が設定されていれば、認証時にユーザーは組織名を入力できます。
</ParamField>

<ParamField query="invitation" type="string">
  組織への招待のチケット ID。[組織にメンバーを招待する](/ja/organizations/invite-members)場合、ユーザーが招待を承諾したときに、アプリケーションは invitation と organization のキーと値のペアを転送して、招待の承諾を処理する必要があります。
</ParamField>

<ParamField query="dpop_jkt" type="string">
  SHA-256 ハッシュ関数を使用する所有証明公開鍵の JWK サムプリント \[RFC7638]。Demonstrating Proof-of-Possession (DPoP) を使用する場合にのみ使用します。
</ParamField>

<div id="response-messages">
  ## レスポンスメッセージ
</div>

| ステータス | 説明             |
| ----- | -------------- |
| 302   | 認可コードを含むリダイレクト |
