# UserPoolIdentityProviderOidcProps

Properties to initialize UserPoolIdentityProviderOidc.

Extends: [UserPoolIdentityProviderProps](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.UserPoolIdentityProviderProps.html)
Used as props by: [UserPoolIdentityProviderOidc](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.UserPoolIdentityProviderOidc.html)

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

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

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'],
};
```

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

# provider_attribute: cognito.ProviderAttribute
# user_pool: cognito.UserPool

user_pool_identity_provider_oidc_props = cognito.UserPoolIdentityProviderOidcProps(
    client_id="clientId",
    client_secret="clientSecret",
    issuer_url="issuerUrl",
    user_pool=user_pool,

    # the properties below are optional
    attribute_mapping=cognito.AttributeMapping(
        address=provider_attribute,
        birthdate=provider_attribute,
        custom={
            "custom_key": provider_attribute
        },
        email=provider_attribute,
        email_verified=provider_attribute,
        family_name=provider_attribute,
        fullname=provider_attribute,
        gender=provider_attribute,
        given_name=provider_attribute,
        last_update_time=provider_attribute,
        locale=provider_attribute,
        middle_name=provider_attribute,
        nickname=provider_attribute,
        phone_number=provider_attribute,
        preferred_username=provider_attribute,
        profile_page=provider_attribute,
        profile_picture=provider_attribute,
        timezone=provider_attribute,
        website=provider_attribute
    ),
    attribute_request_method=cognito.OidcAttributeRequestMethod.GET,
    endpoints=cognito.OidcEndpoints(
        authorization="authorization",
        jwks_uri="jwksUri",
        token="token",
        user_info="userInfo"
    ),
    identifiers=["identifiers"],
    name="name",
    scopes=["scopes"]
)
```

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

ProviderAttribute providerAttribute;
UserPool userPool;

UserPoolIdentityProviderOidcProps userPoolIdentityProviderOidcProps = UserPoolIdentityProviderOidcProps.builder()
        .clientId("clientId")
        .clientSecret("clientSecret")
        .issuerUrl("issuerUrl")
        .userPool(userPool)

        // the properties below are optional
        .attributeMapping(AttributeMapping.builder()
                .address(providerAttribute)
                .birthdate(providerAttribute)
                .custom(Map.of(
                        "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)
                .build())
        .attributeRequestMethod(OidcAttributeRequestMethod.GET)
        .endpoints(OidcEndpoints.builder()
                .authorization("authorization")
                .jwksUri("jwksUri")
                .token("token")
                .userInfo("userInfo")
                .build())
        .identifiers(List.of("identifiers"))
        .name("name")
        .scopes(List.of("scopes"))
        .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;

ProviderAttribute providerAttribute;
UserPool userPool;

var userPoolIdentityProviderOidcProps = new UserPoolIdentityProviderOidcProps {
    ClientId = "clientId",
    ClientSecret = "clientSecret",
    IssuerUrl = "issuerUrl",
    UserPool = userPool,

    // the properties below are optional
    AttributeMapping = new AttributeMapping {
        Address = providerAttribute,
        Birthdate = providerAttribute,
        Custom = new Dictionary<string, ProviderAttribute> {
            { "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 = OidcAttributeRequestMethod.GET,
    Endpoints = new OidcEndpoints {
        Authorization = "authorization",
        JwksUri = "jwksUri",
        Token = "token",
        UserInfo = "userInfo"
    },
    Identifiers = new [] { "identifiers" },
    Name = "name",
    Scopes = new [] { "scopes" }
};
```

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"

var providerAttribute ProviderAttribute
var userPool UserPool

userPoolIdentityProviderOidcProps := &UserPoolIdentityProviderOidcProps{
	ClientId: jsii.String("clientId"),
	ClientSecret: jsii.String("clientSecret"),
	IssuerUrl: jsii.String("issuerUrl"),
	UserPool: userPool,

	// the properties below are optional
	AttributeMapping: &AttributeMapping{
		Address: providerAttribute,
		Birthdate: providerAttribute,
		Custom: map[string]ProviderAttribute{
			"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: awscdk.Aws_cognito.OidcAttributeRequestMethod_GET,
	Endpoints: &OidcEndpoints{
		Authorization: jsii.String("authorization"),
		JwksUri: jsii.String("jwksUri"),
		Token: jsii.String("token"),
		UserInfo: jsii.String("userInfo"),
	},
	Identifiers: []*string{
		jsii.String("identifiers"),
	},
	Name: jsii.String("name"),
	Scopes: []*string{
		jsii.String("scopes"),
	},
}
```

## Properties

- `attributeMapping`: [AttributeMapping](https://docs.aws.amazon.com/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](https://docs.aws.amazon.com/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](https://docs.aws.amazon.com/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](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.IUserPool.html) (required) — The user pool to which this construct provides identities.
