Skip to content
v2.275.0

AppSyncOpenIdConnectConfig Struct ​

Configuration for OpenID Connect authorization in AppSync.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appsync as appsync } from 'aws-cdk-lib';
const appSyncOpenIdConnectConfig: appsync.AppSyncOpenIdConnectConfig = {
  oidcProvider: 'oidcProvider',

  // the properties below are optional
  clientId: 'clientId',
  tokenExpiryFromAuth: 123,
  tokenExpiryFromIssue: 123,
};

Properties ​

clientIdoptionalstringclient_idoptionalstrclientIdoptionalStringClientIdoptionalstringClientIdoptional*string#
The client identifier of the Relying party at the OpenID identity provider.

Default: * (All)

A regular expression can be specified so AppSync can validate against multiple client identifiers at a time.

example
ts
- 'ABCD|CDEF' // where ABCD and CDEF are two different clientId
oidcProviderstringoidc_providerstroidcProviderStringOidcProviderstringOidcProvider*stringrequired#
The issuer for the OIDC configuration.

The issuer returned by discovery must exactly match the value of iss in the OIDC token.

tokenExpiryFromAuthoptionalnumbertoken_expiry_from_authoptionalint | floattokenExpiryFromAuthoptionalNumberTokenExpiryFromAuthoptionaldoubleTokenExpiryFromAuthoptional*float64#
The number of milliseconds an OIDC token is valid after being authenticated by OIDC provider.

Default: no validation

auth_time claim in OIDC token is required for this validation to work.

tokenExpiryFromIssueoptionalnumbertoken_expiry_from_issueoptionalint | floattokenExpiryFromIssueoptionalNumberTokenExpiryFromIssueoptionaldoubleTokenExpiryFromIssueoptional*float64#
The number of milliseconds an OIDC token is valid after being issued to a user.

Default: no validation

This validation uses iat claim of OIDC token.