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

Setup Cognito #30

Closed
5 tasks
briri opened this issue Dec 20, 2022 · 8 comments
Closed
5 tasks

Setup Cognito #30

briri opened this issue Dec 20, 2022 · 8 comments

Comments

@briri
Copy link
Collaborator

briri commented Dec 20, 2022

Update Cognito to allow users to login with Shibboleth and ORCID

@briri
Copy link
Collaborator Author

briri commented Feb 24, 2023

Going to close this one since we're going to fold the React pages into the DMPTool Rails codebase. We will continue to use Cognito for the DMPHub API authentication.

@briri
Copy link
Collaborator Author

briri commented Oct 2, 2023

Reopening this one since we want to investigate the use of Cognito for the new system

@briri briri reopened this Oct 2, 2023
@briri briri removed this from DMPHub 2.0 Oct 2, 2023
@marisastrong
Copy link
Member

1 similar comment
@briri
Copy link
Collaborator Author

briri commented Dec 11, 2023

@marisastrong
Copy link
Member

marisastrong commented Dec 11, 2023

Pros

  • Removes Apache
  • can control access to AWS resources via user pool/IAM?
  • Cognito identity pool ids could be used to allow users to call openSearch (directly from the React UI instead of transiting through the Rails app). It could, if we structure the indices properly, also facilitate fine grained access to openSearch records (e.g. only allowing the user to search their Org's content)

Cons

  • still need to manage InCommon metadata as we will continue as a federated SP to connect with IdPs
  • may not support non-federated institutions as well (need more research on this)
  • less visibility into backend which may negatively impact troubleshooting

@briri
Copy link
Collaborator Author

briri commented Dec 11, 2023

Successfully built a Prototype of the initial Cognito functionality. The work can be found in this repo's cognito-auth branch

  • I added a homepage to the dmphub.uc3dev.cdlib.net site (currently only supports DMP ID landing pages and a 404 page)
  • Added a Cognito Identity Pool attached to the existing UserPool (currently used by the DMPTool to connect to the DMPHub API)
  • Added a Lambda to exchange OAuth grant codes for OAuth tokens
  • The homepage has a Login / Sign Up (and Sign Out if user is already logged in)
  • When the user clicks to Login / Sign up they are redirected to a Cognito authentication form. This test just allowed for email+password auth (no Shib, ORCID, Google at this point)
  • After they login the are redirected to the new Lambda function with an OAuth code. The Lambda calls Cognito to exchange the Code for a Token
  • The Lambda, if successful, redirects the user back to the React page with the token. React stores the token in the user session and then redirects them to a test dashboard page.

@briri
Copy link
Collaborator Author

briri commented Dec 15, 2023

We will use Cognito with just username/email and password to start. This will get us up and running and we can then pivot if we decide that we do not want to support Cognito and instead stick with Shib SP.

@briri briri removed their assignment Dec 15, 2023
@briri briri changed the title Hook Cognito up with Shibboleth and ORCID Setup Cognito Dec 18, 2023
@briri
Copy link
Collaborator Author

briri commented Dec 18, 2023

Breaking this one up into separate tickets.

@briri briri closed this as completed Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants