-
Notifications
You must be signed in to change notification settings - Fork 0
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
9 add a cognito user pool #329
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Abhiek187
added
documentation
Improvements or additions to documentation
enhancement
New feature or request
javascript
Pull requests that update Javascript code
labels
Nov 12, 2023
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
javascript
Pull requests that update Javascript code
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I created a user pool, domain, and client in Cognito for the shop app. Then I implemented an OIDC w/ PKCE auth flow with a sign-in and sign-out button on the profile button. When the user signs in, they are taken to a new tab where they enter their credentials. This was made using Cognito's hosted UI. Once authenticated, the user is sent back to the main tab, and the authorization code they get is exchanged for an ID, access, & refresh token that allows the user to sign in. The ID & access tokens are valid for 1 hour (so the user doesn't have to enter their credentials if they sign in within that time) and the refresh token is valid for 30 days. If the user closes the page and reopens it, as long as the refresh token is present and valid, the user will remain signed in. When the user signs out, all the tokens are revoked, so they can't be used with any AWS APIs. There are fail-safes present if the state/nonce is invalid during sign-in or if the refresh token is tampered with.
I restricted public sign-up for now until I'm comfortable with how user profiles are set up. More features will be implemented that utilize these JWTs, such as a profile page.