Skip to content
v2.274.0

UserPoolIdentityProviderOidcProps Struct ​

Properties to initialize UserPoolIdentityProviderOidc.

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';

declare const providerAttribute: cognito.ProviderAttribute;
declare const userPool: cognito.UserPool;
const userPoolIdentityProviderOidcProps: cognito.UserPoolIdentityProviderOidcProps = {
  clientId: 'clientId',
  clientSecret: 'clientSecret',
  issuerUrl: 'issuerUrl',
  userPool: userPool,

  // the properties below are optional
  attributeMapping: {
    address: providerAttribute,
    birthdate: providerAttribute,
    custom: {
      customKey: providerAttribute,
    },
    email: providerAttribute,
    emailVerified: providerAttribute,
    familyName: providerAttribute,
    fullname: providerAttribute,
    gender: providerAttribute,
    givenName: providerAttribute,
    lastUpdateTime: providerAttribute,
    locale: providerAttribute,
    middleName: providerAttribute,
    nickname: providerAttribute,
    phoneNumber: providerAttribute,
    preferredUsername: providerAttribute,
    profilePage: providerAttribute,
    profilePicture: providerAttribute,
    timezone: providerAttribute,
    website: providerAttribute,
  },
  attributeRequestMethod: cognito.OidcAttributeRequestMethod.GET,
  endpoints: {
    authorization: 'authorization',
    jwksUri: 'jwksUri',
    token: 'token',
    userInfo: 'userInfo',
  },
  identifiers: ['identifiers'],
  name: 'name',
  scopes: ['scopes'],
};

Properties ​

attributeMappingAttributeMappingattribute_mappingAttributeMappingattributeMappingAttributeMappingAttributeMappingAttributeMappingAttributeMappingAttributeMapping#
Mapping attributes from the identity provider to standard and custom attributes of the user pool.

Default: no attribute mapping

attributeRequestMethodOidcAttributeRequestMethodattribute_request_methodOidcAttributeRequestMethodattributeRequestMethodOidcAttributeRequestMethodAttributeRequestMethodOidcAttributeRequestMethodAttributeRequestMethodOidcAttributeRequestMethod= OidcAttributeRequestMethod.GET#
The method to use to request attributes.
clientIdstringclient_idstrclientIdStringClientIdstringClientId*stringrequired#
The client id.
clientSecretstringclient_secretstrclientSecretStringClientSecretstringClientSecret*stringrequired#
The client secret.
endpointsOidcEndpointsendpointsOidcEndpointsendpointsOidcEndpointsEndpointsOidcEndpointsEndpointsOidcEndpoints#
OpenID connect endpoints.

Default: auto discovered with issuer URL

identifiersstring[]identifierstyping.List[str]identifiersList<String>Identifiersstring[]Identifiers*[]*string#
Identifiers.

Default: no identifiers used

Identifiers can be used to redirect users to the correct IdP in multitenant apps.

issuerUrlstringissuer_urlstrissuerUrlStringIssuerUrlstringIssuerUrl*stringrequired#
Issuer URL.
namestringnamestrnameStringNamestringName*string#
The name of the provider.

Default: the unique ID of the construct

scopesstring[]scopestyping.List[str]scopesList<String>Scopesstring[]Scopes*[]*string= ['openid']#
The OAuth 2.0 scopes that you will request from OpenID Connect. Scopes are groups of OpenID Connect user attributes to exchange with your app.
userPoolIUserPooluser_poolIUserPooluserPoolIUserPoolUserPoolIUserPoolUserPoolIUserPoolrequired#
The user pool to which this construct provides identities.