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

# Authorize application

***

title: "アプリケーションを認可する"
description: "OAuth 2.0の認可コードフローを開始し、ユーザーの同意と認可コードを取得します。"
\---"

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

`GET /authorize`

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

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

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

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

\* [認可コードフロー](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow)
\* [Proof Key for Code Exchange (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)

[Resource Owner Password Grant](https://auth0.com/docs/get-started/authentication-and-authorization-flow/resource-owner-password-flow) と [Client Credentials 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) を参照してください。

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

<ParamField query="audience" type="string" required>
  アクセス先のAPIを一意に識別するID。
</ParamField>

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

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

<ParamField query="response_type" type="string" required>
  実行するOAuth 2.0フローをAuth0に示します。Authorization Code Grant Flowには'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。指定しない場合、アプリケーションで**Display Organization Prompt**が設定されていれば、認証時にユーザーが組織名を入力できます。
</ParamField>

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

<ParamField query="dpop_jkt" type="string">
  SHA-256ハッシュ関数を使用した、Proof-of-Possession公開鍵のJWK Thumbprint \[RFC7638]。Demonstrating Proof-of-Possession (DPoP) を使用する場合にのみ指定します。
</ParamField>

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

| ステータス | 説明               |
| ----- | ---------------- |
| 302   | 認可コードを付与してリダイレクト |
