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

# 変更した「トークンの有効期間」が適用されるタイミング

> 「トークンの有効期間」の変更が適用されるタイミングについての説明。

## はじめに

トークンをすでに発行済みのサービスにおいて、トークンの有効期間の値を変更した場合、Authlete は下記のように動作します。

* **すでに発行済み**のトークンの有効期間: **変更なし**（変更前の値のまま）
* 新規**に発行される**トークンの有効期間: **変更後の値**を適用

以下、アクセストークンとリフレッシュトークンについて、具体的な動作を説明します。

## アクセストークン

リフレッシュトークンフローを含む各種フローを使ってアクセストークンが再発行された段階で、新しい有効期間の値が反映されます。

<img src="https://mintcdn.com/authlete/WGQFc11Y4wUplGrc/img/kb/ja/oauth-and-openid-connect/tokens/token-duration-1_ja.png?fit=max&auto=format&n=WGQFc11Y4wUplGrc&q=85&s=c6e4fcd7b8dd9dba1c689c6629c75372" alt="token-duration-1_ja" width="960" height="436" data-path="img/kb/ja/oauth-and-openid-connect/tokens/token-duration-1_ja.png" />

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

「リフレッシュトークン継続使用」の設定によって動作が変わります。\\

<img src="https://mintcdn.com/authlete/WGQFc11Y4wUplGrc/img/kb/ja/oauth-and-openid-connect/tokens/changing-token-durations_1.png?fit=max&auto=format&n=WGQFc11Y4wUplGrc&q=85&s=5415f6a35edb7de50690b93bd1617491" alt="changing-token-durations_1" width="588" height="198" data-path="img/kb/ja/oauth-and-openid-connect/tokens/changing-token-durations_1.png" />

*「トークン」タブの「リフレッシュトークン継続使用」*

* **「継続使用する」を選択している場合**

  * 発行済みのリフレッシュトークンが失効し、再発行されるまでは、新しい値は反映されません。\\
    <img src="https://mintcdn.com/authlete/WGQFc11Y4wUplGrc/img/kb/ja/oauth-and-openid-connect/tokens/token-duration-2_ja.png?fit=max&auto=format&n=WGQFc11Y4wUplGrc&q=85&s=c0a3be0985c93d5b69ceacb55d33cc05" alt="token-duration-2_ja" width="967" height="436" data-path="img/kb/ja/oauth-and-openid-connect/tokens/token-duration-2_ja.png" />
* **「継続使用しない」を選択している場合**

  * リフレッシュトークンフローを使ってアクセストークンを再発行した段階で、リフレッシュトークンの有効期間も新しい値が適用されます。\\
    <img src="https://mintcdn.com/authlete/WGQFc11Y4wUplGrc/img/kb/ja/oauth-and-openid-connect/tokens/token-duration-3_ja.png?fit=max&auto=format&n=WGQFc11Y4wUplGrc&q=85&s=eff630284f0ce5b9459d33b35817386a" alt="token-duration-3_ja" width="967" height="436" data-path="img/kb/ja/oauth-and-openid-connect/tokens/token-duration-3_ja.png" />

### 参考文献

[使用したリフレッシュトークンの継続利用に関する設定](https://kb.authlete.com/ja/s/oauth-and-openid-connect/a/refreshing-refresh-tokens)
