Skip to content

Commit

Permalink
LAWS-3696: adding new cognito user client to maat api
Browse files Browse the repository at this point in the history
Signed-off-by: Fani Foteva <[email protected]>
  • Loading branch information
Fani Foteva committed Apr 2, 2024
1 parent 0b4f63f commit cea2bf1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions terraform/environments/maat/api-cognito.tf
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,17 @@ resource "aws_cognito_user_pool_client" "maat_api_cognito_pool_client_maatos" {
explicit_auth_flows = ["ALLOW_REFRESH_TOKEN_AUTH"]
}

resource "aws_cognito_user_pool_client" "maat_api_cognito_pool_client_cccd" {
depends_on = [aws_cognito_resource_server.maat_api_cognito_user_pool_server]

name = "Claim for Crown Court Defence"
user_pool_id = aws_cognito_user_pool.maat_api_cognito_user_pool.id
allowed_oauth_flows_user_pool_client = true
generate_secret = true
supported_identity_providers = ["COGNITO"]
allowed_oauth_flows = ["client_credentials"]
allowed_oauth_scopes = ["${local.application_name}-cd-api/${local.application_data.accounts[local.environment].maat_api_api_scope}"]
prevent_user_existence_errors = "ENABLED"
explicit_auth_flows = ["ALLOW_REFRESH_TOKEN_AUTH"]
}

3 changes: 2 additions & 1 deletion terraform/environments/maat/api-gw.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ resource "aws_apigatewayv2_authorizer" "maat_api_authorizer" {
aws_cognito_user_pool_client.maat_api_cognito_pool_client_ce.id,
aws_cognito_user_pool_client.maat_api_cognito_pool_client_chs.id,
aws_cognito_user_pool_client.maat_api_cognito_pool_client_maatos.id,
aws_cognito_user_pool_client.maat_api_cognito_pool_client_cvs.id
aws_cognito_user_pool_client.maat_api_cognito_pool_client_cvs.id,
aws_cognito_user_pool_client.maat_api_cognito_pool_client_cccd.id
]
issuer = "https://${aws_cognito_user_pool.maat_api_cognito_user_pool.endpoint}"
}
Expand Down

0 comments on commit cea2bf1

Please sign in to comment.