aws-cdk-lib.aws_cognito.UserPoolIdentityProviderSaml

class UserPoolIdentityProviderSaml (construct)

LanguageType name
.NETAmazon.CDK.AWS.Cognito.UserPoolIdentityProviderSaml
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscognito#UserPoolIdentityProviderSaml
Javasoftware.amazon.awscdk.services.cognito.UserPoolIdentityProviderSaml
Pythonaws_cdk.aws_cognito.UserPoolIdentityProviderSaml
TypeScript (source)aws-cdk-lib » aws_cognito » UserPoolIdentityProviderSaml

Implements IConstruct, IDependable, IResource, IUserPoolIdentityProvider

Represents a identity provider that integrates with SAML.

Example

// 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;
declare const userPoolIdentityProviderSamlMetadata: cognito.UserPoolIdentityProviderSamlMetadata;
const userPoolIdentityProviderSaml = new cognito.UserPoolIdentityProviderSaml(this, 'MyUserPoolIdentityProviderSaml', {
  metadata: userPoolIdentityProviderSamlMetadata,
  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,
  },
  identifiers: ['identifiers'],
  idpSignout: false,
  name: 'name',
});

Initializer

new UserPoolIdentityProviderSaml(scope: Construct, id: string, props: UserPoolIdentityProviderSamlProps)

Parameters

  • scope Construct
  • id string
  • props UserPoolIdentityProviderSamlProps

Construct Props

NameTypeDescription
metadataUserPoolIdentityProviderSamlMetadataThe SAML metadata.
userPoolIUserPoolThe user pool to which this construct provides identities.
attributeMapping?AttributeMappingMapping attributes from the identity provider to standard and custom attributes of the user pool.
identifiers?string[]Identifiers.
idpSignout?booleanWhether to enable the "Sign-out flow" feature.
name?stringThe name of the provider.

metadata

Type: UserPoolIdentityProviderSamlMetadata

The SAML metadata.


userPool

Type: IUserPool

The user pool to which this construct provides identities.


attributeMapping?

Type: AttributeMapping (optional, default: no attribute mapping)

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


identifiers?

Type: string[] (optional, default: no identifiers used)

Identifiers.

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


idpSignout?

Type: boolean (optional, default: false)

Whether to enable the "Sign-out flow" feature.


name?

Type: string (optional, default: the unique ID of the construct)

The name of the provider.

Must be between 3 and 32 characters.

Properties

NameTypeDescription
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
providerNamestringThe primary identifier of this identity provider.
stackStackThe stack in which this resource is defined.

env

Type: ResourceEnvironment

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: Node

The tree node.


providerName

Type: string

The primary identifier of this identity provider.


stack

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
toString()Returns a string representation of this construct.
protected configureAttributeMapping()

applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

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


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


protected configureAttributeMapping()

protected configureAttributeMapping(): any

Returns

  • any