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

Registration page #313

Merged
merged 7 commits into from
Dec 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Roll Back CF Changes
  • Loading branch information
robinje committed Dec 24, 2024
commit 9ceccc32ffbab400287dc9457856d43cc734644f
46 changes: 36 additions & 10 deletions cloudformation/cognito.yml
Original file line number Diff line number Diff line change
@@ -84,26 +84,52 @@ Resources:
UserPoolId: !Ref CognitoUserPool
ClientName: !Ref AppClientName
GenerateSecret: true
AllowedOAuthFlows:
- code
AllowedOAuthScopes:
- openid
- email
- profile
ExplicitAuthFlows:
- ALLOW_ADMIN_USER_PASSWORD_AUTH
- ALLOW_USER_PASSWORD_AUTH
- ALLOW_REFRESH_TOKEN_AUTH
- ALLOW_USER_SRP_AUTH
PreventUserExistenceErrors: ENABLED
CallbackURLs:
- !Ref CallbackURL
LogoutURLs:
- !Ref SignOutURL
PreventUserExistenceErrors: ENABLED
SupportedIdentityProviders:
- COGNITO

CognitoUserPoolDomain:
Type: AWS::Cognito::UserPoolDomain
Properties:
UserPoolId: !Ref CognitoUserPool
Domain: !Ref UserPoolName

CognitoReadOnlyPolicy:
Type: AWS::IAM::ManagedPolicy
Properties:
Description: "Policy providing read-only access to Cognito user objects"
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- cognito-idp:ListUsers
- cognito-idp:DescribeUserPool
Resource: !Sub "arn:aws:cognito-idp:${AWS::Region}:${AWS::AccountId}:userpool/${CognitoUserPool}"

CognitoReadOnlyRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service:
- cognito-idp.amazonaws.com
Action:
- sts:AssumeRole
ManagedPolicyArns:
- !Ref CognitoReadOnlyPolicy
Description: "Role with read-only access to Cognito user objects"

Outputs:
UserPoolId:
Description: The ID of the user pool
@@ -119,4 +145,4 @@ Outputs:
Value: !GetAtt CognitoUserPoolClient.ClientSecret
UserPoolDomain:
Description: The domain of the user pool
Value: !Ref CognitoUserPoolDomain
Value: !Ref CognitoUserPoolDomain