-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Open
Labels
@aws-cdk/aws-cognitoRelated to Amazon CognitoRelated to Amazon Cognito@aws-cdk/aws-elasticloadbalancingv2Related to Amazon Elastic Load Balancing V2Related to Amazon Elastic Load Balancing V2bugThis 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
By using the aws-elasticloadbalancingv2-actions, I noticed that the Cognito construct wants to have the callback URL in all lower case. Because it is not the case, the callback to the loadbalancer is not reached.
Reproduction Steps
Basically, I took it from here
const lb = new elbv2.ApplicationLoadBalancer(this, 'LB', {
vpc,
internetFacing: true,
});
const userPool = new cognito.UserPool(this, 'UserPool');
const userPoolClient = new cognito.UserPoolClient(this, 'Client', {
userPool,
// Required minimal configuration for use with an ELB
generateSecret: true,
authFlows: {
userPassword: true,
},
oAuth: {
flows: {
authorizationCodeGrant: true,
},
scopes: [cognito.OAuthScope.EMAIL],
callbackUrls: [
`https://${lb.loadBalancerDnsName}/oauth2/idpresponse`,
],
},
});
const cfnClient = userPoolClient.node.defaultChild as cognito.CfnUserPoolClient;
cfnClient.addPropertyOverride('RefreshTokenValidity', 1);
cfnClient.addPropertyOverride('SupportedIdentityProviders', ['COGNITO']);
const userPoolDomain = new cognito.UserPoolDomain(this, 'Domain', {
userPool,
cognitoDomain: {
domainPrefix: 'test-cdk-prefix',
},
});
lb.addListener('Listener', {
port: 443,
certificates: [certificate],
defaultAction: new actions.AuthenticateCognitoAction({
userPool,
userPoolClient,
userPoolDomain,
next: elbv2.ListenerAction.fixedResponse(200, {
contentType: 'text/plain',
messageBody: 'Authenticated',
}),
}),
});
new CfnOutput(this, 'DNS', {
value: lb.loadBalancerDnsName,
});
}
}
const app = new App();
new CognitoStack(app, 'integ-cognito');
app.synth();What did you expect to happen?
A redirect to the loadbalancer.
What actually happened?
The cognito domain appends an error.
Environment
- CLI Version : 1.70.0
- Framework Version: 1.70.0
- Node.js Version: 12.18.3
- OS : Ubuntu
- Language (Version): Python 3.8
Other
This is 🐛 Bug Report
namedgraph, mohamed-ali, vitran96, dhatch-niv and boenhoff
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-cognitoRelated to Amazon CognitoRelated to Amazon Cognito@aws-cdk/aws-elasticloadbalancingv2Related to Amazon Elastic Load Balancing V2Related to Amazon Elastic Load Balancing V2bugThis 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