How to modify expiry time of the access and identity tokens for AWS Cognito User Pools

前端 未结 6 2175
生来不讨喜
生来不讨喜 2020-12-25 09:58

I can\'t find any documentation which explains if and how to modify the expiry time of access and identity tokens for AWS Cognito User Pools.

The documentation speci

6条回答
  •  渐次进展
    2020-12-25 10:06

    If you are using CloudFormation template, add the following attribute and specify in days (although the official docs say that it defaults to hours) how long the access token should be valid. Here is an example where Access Token is valid for 24 days.

    UserPoolClient:
        Type: "AWS::Cognito::UserPoolClient"
        Properties:
            ClientName: myuserpoolclient
            GenerateSecret: true
            UserPoolId: !Ref YourUserPool
            AccessTokenValidity: 24
    
    

    Documentation: https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateUserPoolClient.html#CognitoUserPools-CreateUserPoolClient-request-AccessTokenValidity

提交回复
热议问题