-
Notifications
You must be signed in to change notification settings - Fork 4.5k
aws-cognito: oAuth.callbackUrls of UserPoolClient should not have http://example.com #28204
Copy link
Copy link
Open
Labels
@aws-cdk/aws-cognitoRelated to Amazon CognitoRelated to Amazon CognitobugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2
Description
Describe the bug
The property oAuth.callbackUrls of UserPoolClient should be mandatory when flows.authorizationCodeGrant or flows.implicitCodeGrant istrue otherwise, the oAuth.callbackUrls results into ['http://example.com'].
Expected Behavior
An error is thrown when oAuth.callbackUrls is empty but flows.authorizationCodeGrant or flows.implicitCodeGrant istrue.
Current Behavior
oAuth.callbackUrls results into ['http://example.com']
Reproduction Steps
declare const userPoolIdentityProviderOidc: UserPoolIdentityProviderOidc;
// 👇 code goes through
const userPoolClient = new UserPoolClient(this, 'UserPoolClient', {
userPool,
userPoolClientName: `${serviceName}-user-pool-client`,
generateSecret: true,
supportedIdentityProviders: [{
name: userPoolIdentityProviderOidc.providerName,
}],
authFlows: {
userPassword: true,
},
oAuth: {
flows: {
authorizationCodeGrant: true,
},
},
});Possible Solution
Either remove the default or put a guardrail or throw an error when flows.authorizationCodeGrant or flows.implicitCodeGrant istrue and oAuth.callbackUrls is not set.
Additional Information/Context
No response
CDK CLI Version
2.110.0
Framework Version
No response
Node.js Version
18.15
OS
macOS 14.1
Language
TypeScript
Language Version
5.2
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-cognitoRelated to Amazon CognitoRelated to Amazon CognitobugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2