Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the Dev Portal to use an existing Cognito User Pool #291

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danielesalvatore
Copy link
Contributor

Issue #, if available:
Enable the Dev Portal to use an existing Cognito User Pool instead of creating a new one.

Description of changes:
In a situation in which the Developer Portal is adopted by users that already have a AWS setup in place, and in particular an existing, already configured (federations, etc.), customised (UI look&feel, etc.) Cognito User Pool, is now possible to let the Developer Portal to rely on it for the authentication/registration/user manager processed.

In order to implement the feature, the following section has been modified:

  • /dev-portal/deployer-config.js: to enable the user to pass the optional cognitoUserPool param
  • /dev-portal/scripts/deploy-stack.js: to pass the cognitoUserPool to the stack Cloud Formation template.
  • /cloudformation/template.yaml: to implement the conditional logic to use the existing cognitoUserPool instead of creating a new one - while the cognitoUserPool is passed the other User Pool is not created at all.
  • /dev-portal/README.md: to document the new parameter.

While passing an existing User Pool, all the authorisation mechanisms of the stack are still preserved. In particular:

  • the 'admin' group will be added to the existing User Pool Id
  • in the UI, the users placed within this group are the only one to be able to administrate the APIs

It is important to notice that, to re-use the already existing parameter cognitoDomainName and the fact that within the Cloud Formation Template is intended as CognitoDomainNameOrPrefix, the following logic as been implemented:

  • while the user opts to create a new User Pool, this has to be the the Cognito Domain prefix
  • while the integration with an existing User Pool is preferred, this has to be the full URL of the Cognito instance.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jrbeilke
Copy link

+1 this would be great to have when setting up the dev portal and having an existing user pool/identity provider setup

@gonwi
Copy link

gonwi commented Dec 11, 2019

This feature should be merged into the main branch.

@danielesalvatore danielesalvatore requested a review from a user July 20, 2020 21:36
@talipini
Copy link

talipini commented Oct 3, 2021

@danielesalvatore - This has been in there for a while - Was this ever merged to the main branch? Anybody else got this working even if it is not merged to the main? Thanks

@danielesalvatore
Copy link
Contributor Author

Hello @talipini I don't think it was ever merged

@ghost
Copy link

ghost commented Oct 12, 2021

@danielesalvatore Could you rebase and resolve the merge conflicts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants