class UserPoolIdentityProviderOidc (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Cognito.UserPoolIdentityProviderOidc |
Java | software.amazon.awscdk.services.cognito.UserPoolIdentityProviderOidc |
Python | aws_cdk.aws_cognito.UserPoolIdentityProviderOidc |
TypeScript (source) | @aws-cdk/aws-cognito » UserPoolIdentityProviderOidc |
Implements
IConstruct
, IConstruct
, IDependable
, IResource
, IUser
Represents a identity provider that integrates with OpenID Connect.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cognito from '@aws-cdk/aws-cognito';
declare const providerAttribute: cognito.ProviderAttribute;
declare const userPool: cognito.UserPool;
const userPoolIdentityProviderOidc = new cognito.UserPoolIdentityProviderOidc(this, 'MyUserPoolIdentityProviderOidc', {
clientId: 'clientId',
clientSecret: 'clientSecret',
issuerUrl: 'issuerUrl',
userPool: userPool,
// the properties below are optional
attributeMapping: {
address: providerAttribute,
birthdate: providerAttribute,
custom: {
customKey: providerAttribute,
},
email: 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'],
});
Initializer
new UserPoolIdentityProviderOidc(scope: Construct, id: string, props: UserPoolIdentityProviderOidcProps)
Parameters
- scope
Construct
- id
string
- props
User
Pool Identity Provider Oidc Props
Construct Props
Name | Type | Description |
---|---|---|
client | string | The client id. |
client | string | The client secret. |
issuer | string | Issuer URL. |
user | IUser | The user pool to which this construct provides identities. |
attribute | Attribute | Mapping attributes from the identity provider to standard and custom attributes of the user pool. |
attribute | Oidc | The method to use to request attributes. |
endpoints? | Oidc | OpenID connect endpoints. |
identifiers? | string[] | Identifiers. |
name? | string | The name of the provider. |
scopes? | string[] | 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. |
clientId
Type:
string
The client id.
clientSecret
Type:
string
The client secret.
issuerUrl
Type:
string
Issuer URL.
userPool
Type:
IUser
The user pool to which this construct provides identities.
attributeMapping?
Type:
Attribute
(optional, default: no attribute mapping)
Mapping attributes from the identity provider to standard and custom attributes of the user pool.
attributeRequestMethod?
Type:
Oidc
(optional, default: OidcAttributeRequestMethod.GET)
The method to use to request attributes.
endpoints?
Type:
Oidc
(optional, default: auto discovered with issuer URL)
OpenID connect endpoints.
identifiers?
Type:
string[]
(optional, default: no identifiers used)
Identifiers.
Identifiers can be used to redirect users to the correct IdP in multitenant apps.
name?
Type:
string
(optional, default: the unique ID of the construct)
The name of the provider.
scopes?
Type:
string[]
(optional, default: ['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.
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
node | Construct | The construct tree node associated with this construct. |
provider | string | The primary identifier of this identity provider. |
stack | Stack | The stack in which this resource is defined. |
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
node
Type:
Construct
The construct tree node associated with this construct.
providerName
Type:
string
The primary identifier of this identity provider.
stack
Type:
Stack
The stack in which this resource is defined.
Methods
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
to | Returns a string representation of this construct. |
protected configure |
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
AttributeMapping()
protected configureprotected configureAttributeMapping(): any
Returns
any