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

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

`GET /authorize`

これは、ウェブアプリが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` の値は、[Application's Settings](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 Token やアクセストークンにカスタムクレームを追加するには、標準の OIDC クレームとの競合を避けるため、[名前空間付きの形式に準拠している](https://auth0.com/docs/secure/tokens/json-web-tokens/create-custom-claims) 必要があります。
* サイレント認証 を使うと、Auth0 がリダイレクトのみを返し、ログインページを表示しない認証フローを実行できます。アクセストークンの有効期限が切れた場合でも、ユーザーのシングルサインオン (SSO) セッションが有効であれば、ユーザーの操作なしで新しいトークンを取得できます。

<div id="learn-more">
  ### 詳細情報
</div>

* [Implicit Flow](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)
* [Implicit Grant の使用時にリプレイ攻撃を軽減する](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 Tokenのみを取得するには`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 Tokenレスポンスに含まれる文字列値です。
</ParamField>

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

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

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

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

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

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