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

# アプリケーションを認可する

> OAuth 2.0認可フローを開始するには、ユーザーを認可URLに送信して同意を得て認可コードを取得します。

`GET /authorize`

OAuth 2.0認可フローを開始するには、アプリケーションはまずユーザーを認可URLに送信する必要があります。

## 認可エンドポイント

このリクエストの目的は、API（`audience`で指定）を呼び出し、特定の操作（`scope`で指定）をユーザーの代わりに実行することについて、ユーザーから同意を得ることです。Auth0はユーザーを認証し、以前に同意が与えられていない限り、同意を得ます。`scope`の値を変更した場合、Auth0は再度同意を要求します。

ユーザー認可が必要なOAuth 2.0フローは以下の通りです。

* [認可コードフロー](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow)
* [認可コードフロー（PKCE付き）](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow-with-pkce)
* [インプリシットフロー](https://auth0.com/docs/get-started/authentication-and-authorization-flow/implicit-flow-with-form-post)

[リソース所有者パスワードグラント](https://auth0.com/docs/get-started/authentication-and-authorization-flow/resource-owner-password-flow)および[クライアント認証情報フロー](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)。

## パラメーター

<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。[組織にメンバーを招待する](/organizations/invite-members)場合、ユーザーが招待を受け入れるとき、アプリケーションは招待と組織キーと値のペアを転送して招待受け入れを処理する必要があります。
</ParamField>

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

## レスポンス

| ステータス | 説明             |
| ----- | -------------- |
| 302   | 認可コード付きのリダイレクト |
