# AuthenticateOidcOptions

Options for `ListenerAction.authenciateOidc()`.

- Source: [`aws-elasticloadbalancingv2/lib/alb/application-listener-action.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-action.ts#L361)
- Type last changed: v2.79.0 · 10 May 2023

## 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]),
  }),
});
```

## Properties

- `allowHttpsOutbound`: boolean = 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.

- `authenticationRequestExtraParams`: { [key: string]: string } — The query parameters (up to 10) to include in the redirect request to the authorization endpoint.

  **Default:** No extra parameters

- `authorizationEndpoint`: string (required) — The authorization endpoint of the IdP.

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

- `clientId`: string (required) — The OAuth 2.0 client identifier.

- `clientSecret`: [SecretValue](/cdk/api/v2/docs/aws-cdk-lib.SecretValue.html) (required) — The OAuth 2.0 client secret.

- `issuer`: string (required) — The OIDC issuer identifier of the IdP.

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

- `next`: [ListenerAction](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.ListenerAction.html) (required) — What action to execute next.

- `onUnauthenticatedRequest`: [UnauthenticatedAction](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.UnauthenticatedAction.html) — The behavior if the user is not authenticated.

  **Default:** UnauthenticatedAction.AUTHENTICATE

- `scope`: 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.

- `sessionCookieName`: string = "AWSELBAuthSessionCookie" — The name of the cookie used to maintain session information.

- `sessionTimeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.days(7) — The maximum duration of the authentication session.

- `tokenEndpoint`: string (required) — The token endpoint of the IdP.

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

- `userInfoEndpoint`: string (required) — The user info endpoint of the IdP.

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