# UserPoolIdentityProviderOidcProps

Properties to initialize UserPoolIdentityProviderOidc.

Extends: UserPoolIdentityProviderOidcProps
Extends: UserPoolIdentityProviderProps
Used as props by: UserPoolIdentityProviderOidc

- Source: [`aws-cognito/lib/user-pool-idps/oidc.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-cognito/lib/user-pool-idps/oidc.ts#L14)
- Type last changed: v2.27.0 · 3 Jun 2022

## 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

- `attributeMapping`: [AttributeMapping](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.AttributeMapping.html) — Mapping attributes from the identity provider to standard and custom attributes of the user pool.

  **Default:** no attribute mapping

- `attributeRequestMethod`: [OidcAttributeRequestMethod](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.OidcAttributeRequestMethod.html) = OidcAttributeRequestMethod.GET — The method to use to request attributes.

- `clientId`: string (required) — The client id.

- `clientSecret`: string (required) — The client secret.

- `endpoints`: [OidcEndpoints](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.OidcEndpoints.html) — OpenID connect endpoints.

  **Default:** auto discovered with issuer URL

- `identifiers`: string[] — Identifiers.

  **Default:** no identifiers used

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

- `issuerUrl`: string (required) — Issuer URL.

- `name`: string — The name of the provider.

  **Default:** the unique ID of the construct

- `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.

- `userPool`: [IUserPool](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.IUserPool.html) (required) — The user pool to which this construct provides identities.
