# TokenValidityUnitsProperty

The units that validity times are represented in.

The default unit for refresh tokens is days, and the default for ID and access tokens are hours.

- 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_cognito as cognito } from 'aws-cdk-lib';
const tokenValidityUnitsProperty: cognito.CfnUserPoolClient.TokenValidityUnitsProperty = {
  accessToken: 'accessToken',
  idToken: 'idToken',
  refreshToken: 'refreshToken',
};
```

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_cognito as cognito

token_validity_units_property = cognito.CfnUserPoolClient.TokenValidityUnitsProperty(
    access_token="accessToken",
    id_token="idToken",
    refresh_token="refreshToken"
)
```

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.cognito.*;

TokenValidityUnitsProperty tokenValidityUnitsProperty = TokenValidityUnitsProperty.builder()
        .accessToken("accessToken")
        .idToken("idToken")
        .refreshToken("refreshToken")
        .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.Cognito;

var tokenValidityUnitsProperty = new TokenValidityUnitsProperty {
    AccessToken = "accessToken",
    IdToken = "idToken",
    RefreshToken = "refreshToken"
};
```

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"

tokenValidityUnitsProperty := &TokenValidityUnitsProperty{
	AccessToken: jsii.String("accessToken"),
	IdToken: jsii.String("idToken"),
	RefreshToken: jsii.String("refreshToken"),
}
```

## Properties

- `accessToken`: string — A time unit for the value that you set in the `AccessTokenValidity` parameter.

  The default `AccessTokenValidity` time unit is `hours` . `AccessTokenValidity` duration can range from five minutes to one day.

- `idToken`: string — A time unit for the value that you set in the `IdTokenValidity` parameter.

  The default `IdTokenValidity` time unit is `hours` . `IdTokenValidity` duration can range from five minutes to one day.

- `refreshToken`: string — A time unit for the value that you set in the `RefreshTokenValidity` parameter.

  The default `RefreshTokenValidity` time unit is `days` . `RefreshTokenValidity` duration can range from 60 minutes to 10 years.
