@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)",
date="2023-03-22T19:35:48.089Z")
public interface AuthenticateCognitoActionProps
Example:
import software.amazon.awscdk.services.cognito.*; import software.amazon.awscdk.services.ec2.*; import software.amazon.awscdk.services.elasticloadbalancingv2.*; import software.amazon.awscdk.core.App; import software.amazon.awscdk.core.CfnOutput; import software.amazon.awscdk.core.Stack; import software.constructs.Construct; import software.amazon.awscdk.services.elasticloadbalancingv2.actions.*; CognitoStack extends Stack {CognitoStack(ApplicationLoadBalancer lb = ApplicationLoadBalancer.Builder.create(this, "LB") .vpc(vpc) .internetFacing(true) .build(); UserPool userPool = new UserPool(this, "UserPool"); UserPoolClient userPoolClient = UserPoolClient.Builder.create(this, "Client") .userPool(userPool) // Required minimal configuration for use with an ELB .generateSecret(true) .authFlows(AuthFlow.builder() .userPassword(true) .build()) .oAuth(OAuthSettings.builder() .flows(OAuthFlows.builder() .authorizationCodeGrant(true) .build()) .scopes(List.of(OAuthScope.EMAIL)) .callbackUrls(List.of(String.format("https://%s/oauth2/idpresponse", lb.getLoadBalancerDnsName()))) .build()) .build(); CfnUserPoolClient cfnClient = (CfnUserPoolClient)userPoolClient.getNode().getDefaultChild(); cfnClient.addPropertyOverride("RefreshTokenValidity", 1); cfnClient.addPropertyOverride("SupportedIdentityProviders", List.of("COGNITO")); UserPoolDomain userPoolDomain = UserPoolDomain.Builder.create(this, "Domain") .userPool(userPool) .cognitoDomain(CognitoDomainOptions.builder() .domainPrefix("test-cdk-prefix") .build()) .build(); lb.addListener("Listener", BaseApplicationListenerProps.builder() .port(443) .certificates(List.of(certificate)) .defaultAction(AuthenticateCognitoAction.Builder.create() .userPool(userPool) .userPoolClient(userPoolClient) .userPoolDomain(userPoolDomain) .next(ListenerAction.fixedResponse(200, FixedResponseOptions.builder() .contentType("text/plain") .messageBody("Authenticated") .build())) .build()) .build()); CfnOutput.Builder.create(this, "DNS") .value(lb.getLoadBalancerDnsName()) .build(); App app = new App(); new CognitoStack(app, "integ-cognito"); app.synth();
Modifier and Type | Interface and Description |
---|---|
static class |
AuthenticateCognitoActionProps.Builder
A builder for
AuthenticateCognitoActionProps |
static class |
AuthenticateCognitoActionProps.Jsii$Proxy
An implementation for
AuthenticateCognitoActionProps |
Modifier and Type | Method and Description |
---|---|
static AuthenticateCognitoActionProps.Builder |
builder() |
default java.util.Map<java.lang.String,java.lang.String> |
getAuthenticationRequestExtraParams()
The query parameters (up to 10) to include in the redirect request to the authorization endpoint.
|
ListenerAction |
getNext()
What action to execute next.
|
default UnauthenticatedAction |
getOnUnauthenticatedRequest()
The behavior if the user is not authenticated.
|
default java.lang.String |
getScope()
The set of user claims to be requested from the IdP.
|
default java.lang.String |
getSessionCookieName()
The name of the cookie used to maintain session information.
|
default Duration |
getSessionTimeout()
The maximum duration of the authentication session.
|
IUserPool |
getUserPool()
The Amazon Cognito user pool.
|
IUserPoolClient |
getUserPoolClient()
The Amazon Cognito user pool client.
|
IUserPoolDomain |
getUserPoolDomain()
The domain prefix or fully-qualified domain name of the Amazon Cognito user pool.
|
ListenerAction getNext()
Multiple actions form a linked chain; the chain must always terminate in a (weighted)forward, fixedResponse or redirect action.
IUserPool getUserPool()
IUserPoolClient getUserPoolClient()
IUserPoolDomain getUserPoolDomain()
default java.util.Map<java.lang.String,java.lang.String> getAuthenticationRequestExtraParams()
Default: - No extra parameters
default UnauthenticatedAction getOnUnauthenticatedRequest()
Default: UnauthenticatedAction.AUTHENTICATE
default java.lang.String getScope()
To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.
Default: "openid"
default java.lang.String getSessionCookieName()
Default: "AWSELBAuthSessionCookie"
default Duration getSessionTimeout()
Default: Duration.days(7)
static AuthenticateCognitoActionProps.Builder builder()