Cognito Refresh Token ExpiresIn not same with setting refresh token expiration

283 Views Asked by At

Use :

aws-sdk-php v3.163.3

PHP 7.4.8

I set refresh token expiration for 3650 days.

When I want to call refresh token, why result from refresh token for ExpiresIn : 86400 ?

$response = $this->client->adminInitiateAuth([
                'AuthFlow' => 'REFRESH_TOKEN_AUTH',
                'AuthParameters' => [
                    'REFRESH_TOKEN' => $refreshToken,
                    'SECRET_HASH' => $this->cognitoSecretHash($username),
                ],
                'ClientId' => $this->client_id,
                'UserPoolId' => $this->user_pool_id,
            ]);
1

There are 1 best solutions below

1
On

The ExpiresIn you see in the response has nothing to do with the refresh token. The refresh token is still valid for 3650 days from the moment it was first issued. The 86400 seconds you see is only for the IdToken and the AccessToken.