> ## 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 インプリシットフロー を開始し、認可エンドポイントからトークンを直接取得します。

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

`GET /authorize`

Web アプリが API にアクセスするために使用する OAuth 2.0 のグラントです。

<div id="responses">
  ### レスポンス
</div>

<div id="302">
  #### 302
</div>

リクエストが成功すると、ユーザーはアクセストークンが付加された指定のコールバックURLにリダイレクトされます。

```text theme={null}
HTTP/1.1 302 Found
Location: ${account.callback}#access_token=TOKEN&state=STATE&token_type=TYPE&expires_in=SECONDS
```

<div id="remarks">
  ### 注記
</div>

* `redirect_uri` の値は、[アプリケーションの設定](https://manage.auth0.com/dashboard)で有効な コールバックURL として指定する必要があります。
* `response_type=token` の場合、ユーザーがプロバイダーで認証した後、`access_token` をアドレスの `location.hash` に含めた状態で、アプリケーションの コールバックURL にリダイレクトされます。これはシングルページアプリケーションとネイティブモバイル SDK で使用されます。
* Implicit Grant ではリフレッシュトークンは発行されません。代わりに[サイレント認証](https://auth0.com/docs/authenticate/login/configure-silent-authentication)を使用してください。
* アプリケーションとの互換性を向上させるため、Auth0 は今後、[OIDC 仕様で定義されている構造化クレーム形式](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims)でプロファイル情報を返します。つまり、IDトークンまたはアクセストークンにカスタムクレームを追加する場合は、標準の OIDC クレームとの競合を避けるため、[名前空間付き形式に準拠](https://auth0.com/docs/secure/tokens/json-web-tokens/create-custom-claims)している必要があります。
* サイレント認証を使用すると、Auth0 はログインページを表示せず、リダイレクトのみで応答する認証フローを実行できます。アクセストークンの有効期限が切れた場合でも、ユーザーのシングルサインオン (SSO) セッションが有効であれば、ユーザーの操作なしで新しいアクセストークンを取得できます。

<div id="learn-more">
  ### 参考情報
</div>

* [インプリシットフロー](https://auth0.com/docs/get-started/authentication-and-authorization-flow/implicit-flow-with-form-post)
* [state パラメーター](https://auth0.com/docs/secure/attack-protection/state-parameters)
* [インプリシットグラントの使用時にリプレイ攻撃を軽減する](https://auth0.com/docs/get-started/authentication-and-authorization-flow/implicit-flow-with-form-post/mitigate-replay-attacks-when-using-the-implicit-flow)
* [サイレント認証](https://auth0.com/docs/authenticate/login/configure-silent-authentication)

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

<ParamField query="audience" type="string">
  アクセスする対象 API の一意の識別子です。
</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">
  認可をリクエストするスコープです。スペース区切りで指定する必要があります。
</ParamField>

<ParamField query="response_type" type="string" required>
  フローの最後に受け取るトークンの種類を指定します。アクセストークンのみを取得するには `token`、IDトークンのみを取得するには `id_token`、両方を取得するには `id_token token` を使用します。

  使用可能な値: `token`, `id_token`, `id_token token`
</ParamField>

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

<ParamField query="state" type="string">
  CSRF 攻撃を防ぐための不透明な値です。
</ParamField>

<ParamField query="redirect_uri" type="string">
  認可後に Auth0 がブラウザーをリダイレクトする先の URL です。
</ParamField>

<ParamField query="nonce" type="string">
  トークンのリプレイ攻撃を防ぐために IDトークンのレスポンスに含める文字列値です。
</ParamField>

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

<ParamField query="prompt" type="string">
  サイレント認証リクエストを開始するには、`prompt=none` を使用します。
</ParamField>

<ParamField query="organization" type="string">
  ユーザーの認証時に使用する組織の ID です。
</ParamField>

<ParamField query="invitation" type="string">
  組織への招待のチケット ID です。
</ParamField>

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

| ステータス | 説明                                      |
| ----- | --------------------------------------- |
| 302   | 指定されたコールバックURLに、アクセストークンを付加してリダイレクトします。 |
