Skip to content
v2.278.0

TokenValidityUnitsProperty Struct ​

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.

Example ​

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
# 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
// 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();
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"
};
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 ​

accessTokenoptionalstringaccess_tokenoptionalstraccessTokenoptionalStringAccessTokenoptionalstringAccessTokenoptional*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.

idTokenoptionalstringid_tokenoptionalstridTokenoptionalStringIdTokenoptionalstringIdTokenoptional*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.

refreshTokenoptionalstringrefresh_tokenoptionalstrrefreshTokenoptionalStringRefreshTokenoptionalstringRefreshTokenoptional*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.