> ## Documentation Index
> Fetch the complete documentation index at: https://developers.authlete.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> ### Authlete versions
> Authlete 3.0 is the current version. Unless the user says they use another version, answer for Authlete 3.0 using the 3.x documentation.
> Documentation for Authlete 2.x (pages under `/v2/` and `/ja/v2/`) is for the legacy version. Refer to it only when the user is on Authlete 2.x.
>
> ### Authlete architecture
> Authlete is a backend engine for OAuth 2.0 and OpenID Connect processing. End users and client applications do not call it directly; the service provider's authorization server and API server call Authlete's APIs. Authlete handles protocol processing and token, client, and service management, while the service provider owns the OAuth/OIDC endpoints and user authentication.
> See [Architecture](https://developers.authlete.com/get-started/introduction-to-authlete/architecture.md).
>
> ### Concepts
> If the user is new to Authlete, read these pages first:
> - [Request and Response](https://developers.authlete.com/get-started/concepts/request-and-response.md): Core API requests pass the client's request parameters as-is, and responses return `resultCode`, `action`, and `responseContent`.
> - [Action Handling](https://developers.authlete.com/get-started/concepts/action-handling.md): Branch on `action`, never on `resultCode`, and map each action to the HTTP response your server returns.
> - [Two-Step API Calls](https://developers.authlete.com/get-started/concepts/two-step-api-calls.md): Actions such as `INTERACTION` are completed with a second call (`/auth/authorization/issue` or `/auth/authorization/fail`) linked by a `ticket`.
> - [Management API Overview](https://developers.authlete.com/get-started/concepts/overview.md): The Management API configures services, manages clients, and operates issued tokens, separately from the protocol flows handled by the Core API.
> - [API Authentication](https://developers.authlete.com/get-started/concepts/authentication.md): Authlete APIs use bearer tokens: a Service Access Token (one service) or an Organization Token (the whole organization).

# トークンに任意のプロパティをひもづける方法

> Authleteを使用して、アクセストークンや認可コードに任意のプロパティを関連付ける方法について解説しています。

## はじめに

アクセストークンを含む API リクエストを受け取ったリソースサーバーは、そのトークンに付随する情報をもとに、API アクセスの可否や、レスポンスの内容を決定します。基本的な付随情報としてはたとえば、トークンの状態（有効・無効）や、誰（リソースオーナー）が何（クライアント）にどのようなアクセス権（スコープ）を移譲したかなどですが、場合によっては、認可サーバーからさらに他の関連情報を得る必要があります。

Authlete では、アクセストークンまたは認可コードに任意のプロパティ群 (properties) をひもづける機能を持っています。この機能により、認可サーバーはリソースサーバーに対し、API リクエストの可否判定やリクエストの処理内容に必要な情報を提供しやすくなります。また、プロパティの受け渡しはクライアントを介さずに行うことが可能であり、不必要な情報露見を防止できます。

***

## ユースケース

## 例 1: 送金 API の制御

送金機能をもつ銀行 API において「ABC商店へ5,000円を送金する」といった機能を実現するとします。

これを「ABC商店へ5,000円を送金する」というスコープを作って実現しようとすると、送金先および送金額を組み合わせた数のスコープが必要になってしまいます。これは現実的ではありません。

Authlete のプロパティを用いると、認可サーバーがクライアントに対して発行するアクセストークンに、上記の情報をプロパティとして直接埋め込む、ないしは、上記情報を管理する DB のレコードにひもづけておくことができます。クライアントからアクセストークンを受け取った銀行 API は、そのトークンにひもづいているプロパティから上記の情報を取得し、送金可否の判断が可能となります。![extra-properties-money-transfer\_ja](https://mintcdn.com/authlete/NmFoIJ4VSX_LOgob/img/kb/ja/oauth-and-openid-connect/access-tokens/extra-properties-money-transfer_ja.png?fit=max\&auto=format\&n=NmFoIJ4VSX_LOgob\&q=85\&s=37e6d48969069f606f79613d91805c25)

## 例 2: ロールベースのアクセス管理

リソースサーバーが、クライアントから提示されたアクセストークンから、そのトークンにひもづくユーザーの識別子だけではなく、ユーザーの属するグループやロールを知りたいとします。

単純な実現方法としては、リソースサーバーは受け取ったアクセストークンのイントロスペクションを行ってユーザー識別子を取得した上で、そのユーザーのグループやロールを得るために、別のデータベースに問い合わせを行うことになります。

これもまた、Authlete のプロパティを用いると、認可サーバーがユーザーのグループやロールをトークンにひもづけ、その値をリソースサーバーが Authlete から取得する、という連携が可能となり、前述したような、リソースサーバーからデータベースへの問い合わせが不要となります。

![extra-properties-rbac\_ja](https://mintcdn.com/authlete/NmFoIJ4VSX_LOgob/img/kb/ja/oauth-and-openid-connect/access-tokens/extra-properties-rbac_ja.png?fit=max\&auto=format\&n=NmFoIJ4VSX_LOgob\&q=85\&s=55a9a1e4331e949bffc2cd17f25fffee)

***

## 利用方法

本セクションではプロパティの設定・取得の利用方法を紹介します。![extra-properties\_ja](https://mintcdn.com/authlete/NmFoIJ4VSX_LOgob/img/kb/ja/oauth-and-openid-connect/access-tokens/extra-properties_ja.png?fit=max\&auto=format\&n=NmFoIJ4VSX_LOgob\&q=85\&s=9ea052ce2e04a1e3ee88d7ec0610687b)

*Extra properties*

## Property データタイプ

Authlete では、アクセストークンないしは認可コードにひもづけるプロパティ（任意のパラメーター群）を、[Property](https://developers.authlete.com/api-reference/token-endpoint/process-token-request.md#body-properties)
データタイプとして定義しています。Property データタイプは次のようなエントリーを持つ JSON オブジェクトです。

| 名前 | 型 | 説明 |
| - | - | - |
| key | 文字列 | プロパティのキー |
| value | 文字列 | プロパティの値 |
| hidden | 真偽値 | プロパティをクライアントから秘匿するか否かを示すフラグ。true の場合には秘匿する。false の場合には秘匿しない（クライアントに露見する）。 |

たとえば、キーが example\_key、値が example\_value であり、クライアントから秘匿しない（クライアントへの露見を許容する）プロパティは、以下のような JSON オブジェクトになります。

```
{
    "key": "example_key",
    "value": "example_value",
    "hidden": false
}
```

## プロパティのひもづけ

アクセストークンへのプロパティのひもづけは、下記のタイミングで行います。

### 認可サーバーが「認可エンドポイント」から認可コードもしくはアクセストークンを返却する直前

認可サーバーが [/auth/authorization/issue](https://developers.authlete.com/api-reference/authorization-endpoint/issue-authorization-response.md)
API を呼び出す際にプロパティをセットします。

以下は curl コマンドによる実行例です。（見やすさのため折り返しています）

* リクエスト

```shell highlight={6-8} theme={null}
curl -s -X POST https://us.authlete.com/api/${SERVICE_API_KEY}/auth/authorization/issue \
     -H 'Authorization: Bearer ${SERVICE_ACCESS_TOKEN}' \
     -H 'Content-Type: application/json' \
     -d '{"subject":"<subject>",
          "ticket":"<ticket>",
          "properties":[
              {"key":"example_key", "value":"example_value", "hidden":true}
          ]
     }'
```

* レスポンス

```
{
    "resultCode": "A040001",
    "resultMessage": "[A040001] The authorization request was processed successfully.",
    "accessTokenDuration": 0,
    "accessTokenExpiresAt": 0,
    "action": "LOCATION",
    "authorizationCode": "...",
    "responseContent": "https://client.example.org/cb/example.com?code=...&iss=https%3A%2F%2Fauthlete.com"
}
```

> [authlete-java-jaxrs](https://github.com/authlete/authlete-java-jaxrs)
> ライブラリを用いる場合 、[AuthorizationDecisionHandlerSpiAdapter](https://github.com/authlete/authlete-java-jaxrs/blob/master/src/main/java/com/authlete/jaxrs/spi/AuthorizationDecisionHandlerSpiAdapter.java)
> クラスの [getProperties メソッド](https://authlete.github.io/authlete-java-jaxrs/com/authlete/jaxrs/spi/AuthorizationDecisionHandlerSpi.html#getProperties--)
> を変更することで、任意のプロパティーをひもづけすることができます（デフォルトでは、 null が返されます）。

### 認可サーバーが「トークンエンドポイント」からアクセストークンを返却する直前

認可サーバーが [/auth/token](https://developers.authlete.com/api-reference/token-endpoint/process-token-request.md)
API を呼び出す際にプロパティをセットします。以下は curl コマンドによる実行例です。（見やすさのため折り返しています）

* リクエスト

```shell highlight={8-10} theme={null}
curl -s -X POST https://us.authlete.com/api/${SERVICE_API_KEY}/auth/token \
   -H 'Authorization: Bearer ${SERVICE_ACCESS_TOKEN}' \
   -H 'Content-Type: application/json' \
   -d '{
        "clientId": "<clientId>",
        "clientSecret": "<clientSecret>",
        "parameters": "redirect_uri=https://client.example.org/cb/example.com&grant_type=authorization_code&code=...",
        "properties": [
            {"key": "example_key", "value": "example_value", "hidden": false}
        ]
    }'
```

* レスポンス

```json highlight={9-15,23} theme={null}
{
  "resultCode": "A050001",
  "resultMessage":
    "[A050001] The token request (grant_type=authorization_code) was processed
     successfully.",
  "accessToken": "...",
  "action": "OK",
...
  "properties": [
    {
      "hidden": false,
      "key": "example_key",
      "value": "example_value"
    }
  ],
  "refreshToken": "...",
  "responseContent":
    "{\"access_token\":\"...\",
      \"refresh_token\":\"...\",
      \"scope\":\"payment\",
      \"token_type\":\"Bearer\",
      \"expires_in\":300,
      \"example_key\":\"example_value\"     }",
  "subject": "<subject>"
}
```

> ここでは **"hidden":false** としているため、トークンレスポンスの一部として、あるいは [JWT 形式のアクセストークン](https://developers.authlete.com/ja/configuration-reference/tokens-and-claims/using-jwt-based-access-tokens.md)
> を用いた場合にはそのペイロードとして、プロパティがクライアントに開示されます。プロパティをリソースサーバーだけに開示し、クライアントから秘匿する場合には、この値を **false** ではなく **true** とします。

### プロパティの取得

リソースサーバーが [/auth/introspection](https://developers.authlete.com/api-reference/introspection-endpoint/process-introspection-request.md)
API を呼び出すと、そのレスポンスにプロパティが含まれます。以下は curl コマンドによる実行例です。（見やすさのため折り返しています）

* リクエスト

```
curl -s -X POST \
https://us.authlete.com/api/${SERVICE_API_KEY}/auth/introspection \
-H 'Authorization: Bearer ${SERVICE_ACCESS_TOKEN}' \
-H 'Content-Type: application/json' \
-d '{"token":"<accessToken>"}'
```

* レスポンス

```json highlight={3-9} theme={null}
{
    "clientId": <clientId>,
    "properties": [
        {
            "key": "example_key",
            "value": "example_value",
            "hidden": false
        }
    ],
    "action": "OK",
    "resultCode": "A056001",
    "expiresAt": 1565847795000,
    "subject": "<subject>",
    "refreshable": true,
    "usable": true,
    "existent": true,
    "resultMessage": "[A056001] The access token is valid.",
    "responseContent": "Bearer error=\"invalid_request\""
    ...
}
```

***

## フローごとの例

プロパティを渡す API は、フローによって異なります。アクセストークンを発行する API がフローごとに違うためです。ここでは、フローごとに `properties` パラメーターを受け取る API 呼び出しと、その結果としてクライアントおよびリソースサーバーが受け取る内容を示します。

以下の例では、プロパティとして `example_parameter=example_value` を使用します。`${SERVICE_API_KEY}` はサービス ID、Bearer トークンはサービスアクセストークンです。

### 認可コードフロー

1. クライアントからの認可リクエストを [/auth/authorization](https://developers.authlete.com/api-reference/authorization-endpoint/process-authorization-request.md) API に渡します。レスポンスには `action: INTERACTION` と `ticket` が含まれ、`ticket` は次の呼び出しで使用します。

   ```bash theme={null}
   curl -s -X POST https://us.authlete.com/api/${SERVICE_API_KEY}/auth/authorization \
     -H 'Authorization: Bearer ${SERVICE_ACCESS_TOKEN}' \
     -H 'Content-Type: application/json' \
     -d '{ "parameters": "client_id=1048476397&response_type=code&redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb&scope=timeline.read" }'
   ```

2. [/auth/authorization/issue](https://developers.authlete.com/api-reference/authorization-endpoint/issue-authorization-response.md) API で認可コードを発行します。ここで渡したプロパティは認可コードにひもづき、その認可コードと引き換えに発行されるアクセストークンへ引き継がれます。

   ```bash highlight={6-8} theme={null}
   curl -s -X POST https://us.authlete.com/api/${SERVICE_API_KEY}/auth/authorization/issue \
     -H 'Authorization: Bearer ${SERVICE_ACCESS_TOKEN}' \
     -H 'Content-Type: application/json' \
     -d '{ "ticket": "XhPCGRCuKw4QYShCB59yQ-5jq258hZaZ-2QNhdmsUZg",
           "subject": "user123",
           "properties": [
               {"key": "example_parameter", "value": "example_value"}
           ]
         }'
   ```

   ```json theme={null}
   {
     "resultCode": "A040001",
     "resultMessage": "[A040001] The authorization request was processed successfully.",
     "action": "LOCATION",
     "authorizationCode": "HSwoz1hLb-qaEo5oUFhGHZdpdTevHNIrhJotOpOg0_o",
     "responseContent": "https://client.example.org/cb?code=HSwoz1hLb-qaEo5oUFhGHZdpdTevHNIrhJotOpOg0_o&iss=https%3A%2F%2Fauthlete.com"
   }
   ```

   `action: LOCATION` は、認可サーバーがクライアントへ `302 Found` を返し、`responseContent` の値を `Location` ヘッダーに使用することを表します。

3. 認可コードを [/auth/token](https://developers.authlete.com/api-reference/token-endpoint/process-token-request.md) API で交換します。この呼び出しでもプロパティを追加でき、手順 2 で渡したものとマージされます。同じキーが両方にある場合は、`/auth/token` に渡した値が優先されます。

   ```bash highlight={7-9} theme={null}
   curl -s -X POST https://us.authlete.com/api/${SERVICE_API_KEY}/auth/token \
     -H 'Authorization: Bearer ${SERVICE_ACCESS_TOKEN}' \
     -H 'Content-Type: application/json' \
     -d '{ "parameters": "grant_type=authorization_code&code=HSwoz1hLb-qaEo5oUFhGHZdpdTevHNIrhJotOpOg0_o&redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb",
           "clientId": "1048476397",
           "clientSecret": "${CLIENT_SECRET}",
           "properties": [
               {"key": "additional_parameter", "value": "additional_value"}
           ]
         }'
   ```

   ```json highlight={5-16,19} theme={null}
   {
     "resultCode": "A050001",
     "resultMessage": "[A050001] The token request (grant_type=authorization_code) was processed successfully.",
     "action": "OK",
     "properties": [
       {
         "key": "additional_parameter",
         "value": "additional_value",
         "hidden": false
       },
       {
         "key": "example_parameter",
         "value": "example_value",
         "hidden": false
       }
     ],
     "accessToken": "LN-42WCA9hGmTbiKVfnyG8zFssh1S99YdLZ-uZ7Dg04",
     "refreshToken": "pbUei8l4-2cFL31zfBsaX9MO83SvNYmLfIJQxxYXAwU",
     "responseContent": "{\"access_token\":\"LN-42WCA9hGmTbiKVfnyG8zFssh1S99YdLZ-uZ7Dg04\",\"token_type\":\"Bearer\",\"expires_in\":86400,\"scope\":\"timeline.read\",\"refresh_token\":\"pbUei8l4-2cFL31zfBsaX9MO83SvNYmLfIJQxxYXAwU\",\"additional_parameter\":\"additional_value\",\"example_parameter\":\"example_value\"}"
   }
   ```

   `action: OK` は、認可サーバーがクライアントへ `200 OK` を返し、`responseContent` の値をレスポンスボディに使用することを表します。どちらのプロパティも `hidden` を指定していないため、クライアントに開示されます。

### インプリシットフロー

アクセストークンは認可エンドポイントから発行されるため、プロパティを渡せるのは `/auth/authorization/issue` だけです。

1. `response_type=token` の認可リクエストを `/auth/authorization` API に渡し、レスポンスから `ticket` を取得します。

   ```bash theme={null}
   curl -s -X POST https://us.authlete.com/api/${SERVICE_API_KEY}/auth/authorization \
     -H 'Authorization: Bearer ${SERVICE_ACCESS_TOKEN}' \
     -H 'Content-Type: application/json' \
     -d '{ "parameters": "client_id=1048476397&response_type=token&redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb&scope=timeline.read" }'
   ```

2. `/auth/authorization/issue` API でアクセストークンを発行します。プロパティはここで渡します。

   ```bash highlight={6-8} theme={null}
   curl -s -X POST https://us.authlete.com/api/${SERVICE_API_KEY}/auth/authorization/issue \
     -H 'Authorization: Bearer ${SERVICE_ACCESS_TOKEN}' \
     -H 'Content-Type: application/json' \
     -d '{ "ticket": "j3OkWV4r8TEKeCTLPY8c_BfrYAbKYEy2FXZUaiYKAYU",
           "subject": "user123",
           "properties": [
               {"key": "example_parameter", "value": "example_value"}
           ]
         }'
   ```

   ```json highlight={5} theme={null}
   {
     "resultCode": "A040001",
     "resultMessage": "[A040001] The authorization request was processed successfully.",
     "action": "LOCATION",
     "responseContent": "https://client.example.org/cb#access_token=VHnmJTwVdiS69oY_RLT9kYhdMUWqNdUEVHITdy_81ak&token_type=Bearer&expires_in=86400&scope=timeline.read&example_parameter=example_value&iss=https%3A%2F%2Fauthlete.com",
     "accessToken": "VHnmJTwVdiS69oY_RLT9kYhdMUWqNdUEVHITdy_81ak"
   }
   ```

   プロパティは、リダイレクト URI のフラグメントに `access_token` と並んで付加され、クライアントへ渡ります。

### クライアントクレデンシャルズフロー

認可エンドポイントを経由しないため、プロパティはトークンリクエストとともに `/auth/token` へ渡します。

```bash highlight={7-9} theme={null}
curl -s -X POST https://us.authlete.com/api/${SERVICE_API_KEY}/auth/token \
  -H 'Authorization: Bearer ${SERVICE_ACCESS_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{ "parameters": "grant_type=client_credentials&scope=timeline.read",
        "clientId": "1048476397",
        "clientSecret": "${CLIENT_SECRET}",
        "properties": [
            {"key": "example_parameter", "value": "example_value"}
        ]
      }'
```

```json theme={null}
{
  "resultCode": "A052001",
  "resultMessage": "[A052001] The token request (grant_type=client_credentials) was processed successfully.",
  "action": "OK",
  "properties": [
    {
      "key": "example_parameter",
      "value": "example_value",
      "hidden": false
    }
  ],
  "responseContent": "{\"access_token\":\"jC9TsQVcb0tE30pZ2jGu9S_fUB_r7AFACqcJOkl4HFA\",\"token_type\":\"Bearer\",\"expires_in\":86400,\"scope\":\"timeline.read\",\"example_parameter\":\"example_value\"}"
}
```

このフローを使用するにはクライアントタイプがコンフィデンシャルである必要があり、リフレッシュトークンは発行されません（[RFC 6749, 4.4.3](https://www.rfc-editor.org/rfc/rfc6749#section-4.4.3)）。

### リソースオーナーパスワードクレデンシャルズフロー

トークンの発行が 2 段階に分かれており、プロパティを渡せるのは 2 番目の呼び出しだけです。

1. トークンリクエストを `/auth/token` API に渡します。レスポンスには `action: PASSWORD` と、クライアントが送信した `username` および `password` がそのまま含まれます。認可サーバーはこれらでユーザー認証を行います。

   > [!NOTE]
   >
   > `grant_type` が `password` の場合、`/auth/token` に渡したプロパティは破棄されます。プロパティは `/auth/token/issue` に渡してください。

   ```bash theme={null}
   curl -s -X POST https://us.authlete.com/api/${SERVICE_API_KEY}/auth/token \
     -H 'Authorization: Bearer ${SERVICE_ACCESS_TOKEN}' \
     -H 'Content-Type: application/json' \
     -d '{ "parameters": "grant_type=password&username=john&password=secret",
           "clientId": "1048476397",
           "clientSecret": "${CLIENT_SECRET}"
         }'
   ```

   ```json theme={null}
   {
     "resultCode": "A051001",
     "resultMessage": "[A051001] Authlete has successfully issued a ticket to the service (API Key = 4239612149) for the token request from the client (ID = 1048476397). [grant_type=password]",
     "action": "PASSWORD",
     "username": "john",
     "password": "secret",
     "ticket": "gS1B19zO0c8DzN5jpac2PIWa9M1h2bFX9u6MzRi0X58"
   }
   ```

2. ユーザー認証が完了したら、[/auth/token/issue](https://developers.authlete.com/api-reference/token-endpoint/issue-token-response.md) API でアクセストークンを発行します。認証されたユーザーを `subject` に、ひもづけるプロパティを `properties` に指定します。

   ```bash highlight={6-8} theme={null}
   curl -s -X POST https://us.authlete.com/api/${SERVICE_API_KEY}/auth/token/issue \
     -H 'Authorization: Bearer ${SERVICE_ACCESS_TOKEN}' \
     -H 'Content-Type: application/json' \
     -d '{ "ticket": "gS1B19zO0c8DzN5jpac2PIWa9M1h2bFX9u6MzRi0X58",
           "subject": "user123",
           "properties": [
               {"key": "example_parameter", "value": "example_value"}
           ]
         }'
   ```

   ```json theme={null}
   {
     "resultCode": "A054001",
     "resultMessage": "[A054001] The token request (grant_type=password) was processed successfully.",
     "action": "OK",
     "properties": [
       {
         "key": "example_parameter",
         "value": "example_value",
         "hidden": false
       }
     ],
     "responseContent": "{\"access_token\":\"jRdB_IwMkIyjvFkZTE5PBm1rbzz96x8Y0oF2MGagsVo\",\"token_type\":\"Bearer\",\"expires_in\":86400,\"scope\":null,\"refresh_token\":\"a3NqLMT87HKgLblRkg51ga-xCY3OI_voPvC5uzLxQDg\",\"example_parameter\":\"example_value\"}"
   }
   ```

### リフレッシュトークンフロー

`grant_type=refresh_token` で `/auth/token` に渡したプロパティは、そのリフレッシュトークンがひもづくアクセストークンが既に持つプロパティに**マージ**されます。新しいキーは追加され、既にあるキーはここで渡した値で上書きされます。以下のリフレッシュトークンは認可コードフローで発行されたもので、そのアクセストークンは `example_parameter` と `additional_parameter` を持っています。

```bash highlight={7-9} theme={null}
curl -s -X POST https://us.authlete.com/api/${SERVICE_API_KEY}/auth/token \
  -H 'Authorization: Bearer ${SERVICE_ACCESS_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{ "parameters": "grant_type=refresh_token&refresh_token=pbUei8l4-2cFL31zfBsaX9MO83SvNYmLfIJQxxYXAwU",
        "clientId": "1048476397",
        "clientSecret": "${CLIENT_SECRET}",
        "properties": [
            {"key": "extra_parameter", "value": "extra_value"}
        ]
      }'
```

新しく発行されたアクセストークンは 3 つのプロパティを持ちます。リソースサーバーはこれをイントロスペクション API で取得します。

```bash theme={null}
curl -s -X POST https://us.authlete.com/api/${SERVICE_API_KEY}/auth/introspection \
  -H 'Authorization: Bearer ${SERVICE_ACCESS_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{ "token": "SJKrkYzT16OInwg0gKjC6bhPo9rUNRGRDMD1c8YUHNE" }'
```

```json highlight={7-23} theme={null}
{
  "resultCode": "A056001",
  "resultMessage": "[A056001] The access token is valid.",
  "action": "OK",
  "clientId": 1048476397,
  "subject": "user123",
  "properties": [
    {
      "key": "additional_parameter",
      "value": "additional_value",
      "hidden": false
    },
    {
      "key": "example_parameter",
      "value": "example_value",
      "hidden": false
    },
    {
      "key": "extra_parameter",
      "value": "extra_value",
      "hidden": false
    }
  ],
  "refreshable": true,
  "usable": true,
  "existent": true,
  "expiresAt": 1789564519772,
  "responseContent": "Bearer error=\"invalid_request\""
}
```

## 制限事項

## キーの値

以下の値は認可サーバーから返される応答に含まれるパラメーター群として、 [RFC 6749](https://tools.ietf.org/html/rfc6749)
と [OpenID Connect Core 1.0](http://openid.net/specs/openid-connect-core-1_0.html)
にて予約されているため、キーとして指定できません。指定された場合には Authlete サーバーが破棄します。

* access\_token
* token\_type
* expires\_in
* refresh\_token
* scope
* error
* error\_description
* error\_uri
* id\_token

## プロパティの値

指定可能な値は文字列のみです。真偽値や配列等は指定できません。

## サイズ

指定されたプロパティー群は、次のような処理を経て Authlete サーバー側のデータベース内に保存されます。最終的に生成された文字列の長さが 65,535 を超える場合にはエラーとなります。

1. 三次元の文字列に変換する

   * 例：\[\["example\_parameter","example\_value",null]]
     (hidden の値は null か空文字列に変換されます。それぞれ、false と true を表します。)

2. JSON 文字列に変換する

   * 例: "\[\["example\_parameter":"example\_value",null]]"

3. AES/CBC/PKCS5Padding で暗号化する

4. base64url でエンコードする


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.