Skip to content
v2.278.0

AuthenticateOidcOptions Struct ​

Options for ListenerAction.authenciateOidc().

Example ​

ts
declare const listener: elbv2.ApplicationListener;
declare const myTargetGroup: elbv2.ApplicationTargetGroup;

listener.addAction('DefaultAction', {
  action: elbv2.ListenerAction.authenticateOidc({
    authorizationEndpoint: 'https://example.com/openid',
    // Other OIDC properties here
    clientId: '...',
    clientSecret: SecretValue.secretsManager('...'),
    issuer: '...',
    tokenEndpoint: '...',
    userInfoEndpoint: '...',

    // Next
    next: elbv2.ListenerAction.forward([myTargetGroup]),
  }),
});
python
# listener: elbv2.ApplicationListener
# my_target_group: elbv2.ApplicationTargetGroup


listener.add_action("DefaultAction",
    action=elbv2.ListenerAction.authenticate_oidc(
        authorization_endpoint="https://example.com/openid",
        # Other OIDC properties here
        client_id="...",
        client_secret=SecretValue.secrets_manager("..."),
        issuer="...",
        token_endpoint="...",
        user_info_endpoint="...",

        # Next
        next=elbv2.ListenerAction.forward([my_target_group])
    )
)
java
ApplicationListener listener;
ApplicationTargetGroup myTargetGroup;


listener.addAction("DefaultAction", AddApplicationActionProps.builder()
        .action(ListenerAction.authenticateOidc(AuthenticateOidcOptions.builder()
                .authorizationEndpoint("https://example.com/openid")
                // Other OIDC properties here
                .clientId("...")
                .clientSecret(SecretValue.secretsManager("..."))
                .issuer("...")
                .tokenEndpoint("...")
                .userInfoEndpoint("...")

                // Next
                .next(ListenerAction.forward(List.of(myTargetGroup)))
                .build()))
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
ApplicationListener listener;
ApplicationTargetGroup myTargetGroup;


listener.AddAction("DefaultAction", new AddApplicationActionProps {
    Action = ListenerAction.AuthenticateOidc(new AuthenticateOidcOptions {
        AuthorizationEndpoint = "https://example.com/openid",
        // Other OIDC properties here
        ClientId = "...",
        ClientSecret = SecretValue.SecretsManager("..."),
        Issuer = "...",
        TokenEndpoint = "...",
        UserInfoEndpoint = "...",

        // Next
        Next = ListenerAction.Forward(new [] { myTargetGroup })
    })
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var listener ApplicationListener
var myTargetGroup ApplicationTargetGroup


listener.AddAction(jsii.String("DefaultAction"), &AddApplicationActionProps{
	Action: elbv2.ListenerAction_AuthenticateOidc(&AuthenticateOidcOptions{
		AuthorizationEndpoint: jsii.String("https://example.com/openid"),
		// Other OIDC properties here
		ClientId: jsii.String("..."),
		ClientSecret: awscdk.SecretValue_SecretsManager(jsii.String("...")),
		Issuer: jsii.String("..."),
		TokenEndpoint: jsii.String("..."),
		UserInfoEndpoint: jsii.String("..."),

		// Next
		Next: elbv2.ListenerAction_Forward([]IApplicationTargetGroup{
			myTargetGroup,
		}),
	}),
})

Properties ​

allowHttpsOutboundoptionalbooleanallow_https_outboundoptionalboolallowHttpsOutboundoptionalBooleanAllowHttpsOutboundoptionalboolAllowHttpsOutboundoptional*bool = true #
Allow HTTPS outbound traffic to communicate with the IdP.

Set this property to false if the IP address used for the IdP endpoint is identifiable and you want to control outbound traffic. Then allow HTTPS outbound traffic to the IdP's IP address using the listener's connections property.

authenticationRequestExtraParamsoptional{ [key: string]: string }authentication_request_extra_paramsoptionaltyping.Mapping[str, str]authenticationRequestExtraParamsoptionalMap<String, String>AuthenticationRequestExtraParamsoptionalIDictionary<string, string>AuthenticationRequestExtraParamsoptional*map[string]*string #
The query parameters (up to 10) to include in the redirect request to the authorization endpoint.

Default: No extra parameters

authorizationEndpointstringauthorization_endpointstrauthorizationEndpointStringAuthorizationEndpointstringAuthorizationEndpoint*string required #
The authorization endpoint of the IdP.

This must be a full URL, including the HTTPS protocol, the domain, and the path.

clientIdstringclient_idstrclientIdStringClientIdstringClientId*string required #
The OAuth 2.0 client identifier.
clientSecretSecretValueclient_secretSecretValueclientSecretSecretValueClientSecretSecretValueClientSecretSecretValue required #
The OAuth 2.0 client secret.
issuerstringissuerstrissuerStringIssuerstringIssuer*string required #
The OIDC issuer identifier of the IdP.

This must be a full URL, including the HTTPS protocol, the domain, and the path.

onUnauthenticatedRequestoptionalUnauthenticatedActionon_unauthenticated_requestoptionalUnauthenticatedActiononUnauthenticatedRequestoptionalUnauthenticatedActionOnUnauthenticatedRequestoptionalUnauthenticatedActionOnUnauthenticatedRequestoptionalUnauthenticatedAction #
The behavior if the user is not authenticated.

Default: UnauthenticatedAction.AUTHENTICATE

scopeoptionalstringscopeoptionalstrscopeoptionalStringScopeoptionalstringScopeoptional*string = "openid" #
The set of user claims to be requested from the IdP.

To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.

sessionCookieNameoptionalstringsession_cookie_nameoptionalstrsessionCookieNameoptionalStringSessionCookieNameoptionalstringSessionCookieNameoptional*string = "AWSELBAuthSessionCookie" #
The name of the cookie used to maintain session information.
sessionTimeoutoptionalDurationsession_timeoutoptionalDurationsessionTimeoutoptionalDurationSessionTimeoutoptionalDurationSessionTimeoutoptionalDuration = Duration.days(7) #
The maximum duration of the authentication session.
tokenEndpointstringtoken_endpointstrtokenEndpointStringTokenEndpointstringTokenEndpoint*string required #
The token endpoint of the IdP.

This must be a full URL, including the HTTPS protocol, the domain, and the path.

userInfoEndpointstringuser_info_endpointstruserInfoEndpointStringUserInfoEndpointstringUserInfoEndpoint*string required #
The user info endpoint of the IdP.

This must be a full URL, including the HTTPS protocol, the domain, and the path.