Stop storing CallbacksUrl & LogoutURLs settings in oAuthMetadata in auth parameters.json
See original GitHub issueIs your feature request related to a problem? Please describe.
We have an Amplify project that uses Cognito and Auth.federatedSignIn. We have multiple environments: prod, preprod, dev, QA, … For all of our environments the CallbacksUrl are differents, they look like:
- example.com
- preprod.example.com
- dev1.example.com
Today values of the CallbacksUrl and LogoutURLs are defined in amplify/backend/auth/<my-auth>/parameters.json so this value is shared among environment. Because of that we need to override values manually in Cognito in the AWS console with the risk of having the value erased again if the auth is deployed again. This makes a multi-env and/or team work on our Amplify project very painful.
An associated problem is that those CallbacksUrl and LogoutURLs values are injected in aws-exports.js in oauth section:
"oauth": {
...
"redirectSignIn": "https://example.com",
"redirectSignOut": "https://example.com/logout",
...
},
We also have to override that at compile time in a npm script with Regex to force Auth class or Amplify-js framework to use our custom values. This is an extra pain point.
Describe the solution you’d like
I like you to store the CallbacksUrl and LogoutURLs setting in team-provider-info.json. This way all env have a specific value. Then when the developer change the values in team-provider-info.json, detect that the auth needs to be updated. This specific need is explained here #5403 in a more general context.
These CallbacksUrl and LogoutURLs values will be injected in aws-export.js accordingly to the current checked out env.
The other settings (AllowedOAuthFlows, AllowedOAuthScopes) can be kept the same we share the same value in all our env.
Bonus: When we update the value in an env in team-provider-info.json that will be great if you can push the change.
Describe alternatives you’ve considered
We created a custom resource with a Lambda that override the value playing with Cognito APIs (not within CloudFormation). This is a pain to write that and maintain it.
Additional context
Our project is opensource (and can be deployed by other people in their own env) which make the hardcoding of CallbacksUrl an extra pain.
This ticket will be easier to solve with #5403 done
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
This is a huge pain for us as well. Why was it closed?
I think the stale bot needs different parameters when it’s closing things after just a month, but the development team can take many months to reply or make progress on issues.
Is there any idea or eta on when this might be added to the core functionality?