Mohammed Fairoz
Mohammed Fairoz

Reputation: 1

AWS Cognito User Pool Client: Updating RefreshTokenValidity without losing callback URLs using cloud formation yaml

I have a Cognito user pool client application that is integrated with other application, and I need to increase the RefreshTokenValidity using CloudFormation YAML. However, whenever I update the RefreshTokenValidity property, all the callback URLs that were previously added during authentication get deleted. Here's a snippet of my CloudFormation YAML:

DemoCognitoOpenIdClient:
Type: AWS::Cognito::UserPoolClient
Properties:
UserPoolId: !Ref CognitoUserPool
ClientName: DemoCognitoOpenIdClient
GenerateSecret: true
ExplicitAuthFlows:
- ALLOW_REFRESH_TOKEN_AUTH
- ALLOW_USER_SRP_AUTH - ALLOW_CUSTOM_AUTH - ALLOW_USER_PASSWORD_AUTH - ALLOW_ADMIN_USER_PASSWORD_AUTH
AllowedOAuthFlowsUserPoolClient: true
AllowedOAuthScopes: - openid - phone - email
TokenValidityUnits:
AccessToken: hours
IdToken: hours
RefreshToken: days
AuthSessionValidity: 3
RefreshTokenValidity: 190 # Current value
AccessTokenValidity: 1
IdTokenValidity: 1
EnableTokenRevocation: true
PreventUserExistenceErrors: ENABLED
SupportedIdentityProviders:
- "COGNITO" CallbackURLs:
- https://.zyx.com - https://.xyz.com
AllowedOAuthFlows: - "code"

How can I update the RefreshTokenValidity property without losing the callback URLs? Is there a specific approach or option in CloudFormation or AWS CLI that allows me to achieve this without affecting existing configurations that we may updated using manually or using some other application?

Any guidance or insights would be greatly appreciated. Thank you!

I need to increase the refresh token validity without losing any existing callback URLs associated with Salesforce. How can I achieve this through CloudFormation without deleting the callback URLs?

Upvotes: 0

Views: 86

Answers (0)

Related Questions