Skip to content
Discussion options

You must be logged in to vote

I solve this by creating the UserPoolClient in that account/cdk-app where the UserPool was created. Then I simply pass the UserPoolClientId via environment param and set this to JwtAudience of the authorizer.
This is my code (note this is golang):

authorizer := awscdkapigatewayv2alpha.NewHttpAuthorizer(stack, jsii.String("MyHttpAuthorizer"), &awscdkapigatewayv2alpha.HttpAuthorizerProps{
	AuthorizerName: jsii.String("MyHttpAuthorizer"),
	HttpApi:        httpApi,
	Type:           awscdkapigatewayv2alpha.HttpAuthorizerType_JWT,
	JwtIssuer:      jsii.String("https://cognito-idp." + *props.Env.Region + ".amazonaws.com/" + props.CognitoUserPoolId),
	JwtAudience:    jsii.Strings(props.CognitoApp…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@stowg
Comment options

Answer selected by peterwoodworth
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants