# AuthenticateCognitoConfigProperty

Specifies information required when integrating with Amazon Cognito to authenticate users.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_elasticloadbalancingv2 as elbv2 } from 'aws-cdk-lib';
const authenticateCognitoConfigProperty: elbv2.CfnListenerRule.AuthenticateCognitoConfigProperty = {
  userPoolArn: 'userPoolArn',
  userPoolClientId: 'userPoolClientId',
  userPoolDomain: 'userPoolDomain',

  // the properties below are optional
  authenticationRequestExtraParams: {
    authenticationRequestExtraParamsKey: 'authenticationRequestExtraParams',
  },
  onUnauthenticatedRequest: 'onUnauthenticatedRequest',
  scope: 'scope',
  sessionCookieName: 'sessionCookieName',
  sessionTimeout: 123,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_elasticloadbalancingv2 as elbv2

authenticate_cognito_config_property = elbv2.CfnListenerRule.AuthenticateCognitoConfigProperty(
    user_pool_arn="userPoolArn",
    user_pool_client_id="userPoolClientId",
    user_pool_domain="userPoolDomain",

    # the properties below are optional
    authentication_request_extra_params={
        "authentication_request_extra_params_key": "authenticationRequestExtraParams"
    },
    on_unauthenticated_request="onUnauthenticatedRequest",
    scope="scope",
    session_cookie_name="sessionCookieName",
    session_timeout=123
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.elasticloadbalancingv2.*;

AuthenticateCognitoConfigProperty authenticateCognitoConfigProperty = AuthenticateCognitoConfigProperty.builder()
        .userPoolArn("userPoolArn")
        .userPoolClientId("userPoolClientId")
        .userPoolDomain("userPoolDomain")

        // the properties below are optional
        .authenticationRequestExtraParams(Map.of(
                "authenticationRequestExtraParamsKey", "authenticationRequestExtraParams"))
        .onUnauthenticatedRequest("onUnauthenticatedRequest")
        .scope("scope")
        .sessionCookieName("sessionCookieName")
        .sessionTimeout(123)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ElasticLoadBalancingV2;

var authenticateCognitoConfigProperty = new AuthenticateCognitoConfigProperty {
    UserPoolArn = "userPoolArn",
    UserPoolClientId = "userPoolClientId",
    UserPoolDomain = "userPoolDomain",

    // the properties below are optional
    AuthenticationRequestExtraParams = new Dictionary<string, string> {
        { "authenticationRequestExtraParamsKey", "authenticationRequestExtraParams" }
    },
    OnUnauthenticatedRequest = "onUnauthenticatedRequest",
    Scope = "scope",
    SessionCookieName = "sessionCookieName",
    SessionTimeout = 123
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

authenticateCognitoConfigProperty := &AuthenticateCognitoConfigProperty{
	UserPoolArn: jsii.String("userPoolArn"),
	UserPoolClientId: jsii.String("userPoolClientId"),
	UserPoolDomain: jsii.String("userPoolDomain"),

	// the properties below are optional
	AuthenticationRequestExtraParams: map[string]*string{
		"authenticationRequestExtraParamsKey": jsii.String("authenticationRequestExtraParams"),
	},
	OnUnauthenticatedRequest: jsii.String("onUnauthenticatedRequest"),
	Scope: jsii.String("scope"),
	SessionCookieName: jsii.String("sessionCookieName"),
	SessionTimeout: jsii.Number(123),
}
```

## Properties

- `authenticationRequestExtraParams`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | { [key: string]: string } — The query parameters (up to 10) to include in the redirect request to the authorization endpoint.

- `onUnauthenticatedRequest`: string — The behavior if the user is not authenticated. The following are possible values:.

  - deny `` - Return an HTTP 401 Unauthorized error.
  - allow `` - Allow the request to be forwarded to the target.
  - authenticate `` - Redirect the request to the IdP authorization endpoint. This is the default value.

- `scope`: string — The set of user claims to be requested from the IdP. The default is `openid` .

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

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

  The default is AWSELBAuthSessionCookie.

- `sessionTimeout`: number — The maximum duration of the authentication session, in seconds.

  The default is 604800 seconds (7 days).

- `userPoolArn`: string (required) — The Amazon Resource Name (ARN) of the Amazon Cognito user pool.

- `userPoolClientId`: string (required) — The ID of the Amazon Cognito user pool client.

- `userPoolDomain`: string (required) — The domain prefix or fully-qualified domain name of the Amazon Cognito user pool.
