class UserPoolIdentityProviderSaml (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Cognito.UserPoolIdentityProviderSaml |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscognito#UserPoolIdentityProviderSaml |
![]() | software.amazon.awscdk.services.cognito.UserPoolIdentityProviderSaml |
![]() | aws_cdk.aws_cognito.UserPoolIdentityProviderSaml |
![]() | aws-cdk-lib » aws_cognito » UserPoolIdentityProviderSaml |
Implements
IConstruct
, IDependable
, IResource
, IUser
Represents an identity provider that integrates with SAML.
Example
const userpool = new cognito.UserPool(this, 'Pool');
// specify the metadata as a file content
new cognito.UserPoolIdentityProviderSaml(this, 'userpoolIdpFile', {
userPool: userpool,
metadata: cognito.UserPoolIdentityProviderSamlMetadata.file('my-file-contents'),
// Whether to require encrypted SAML assertions from IdP
encryptedResponses: true,
// The signing algorithm for the SAML requests
requestSigningAlgorithm: cognito.SigningAlgorithm.RSA_SHA256,
// Enable IdP initiated SAML auth flow
idpInitiated: true,
});
// specify the metadata as a URL
new cognito.UserPoolIdentityProviderSaml(this, 'userpoolidpUrl', {
userPool: userpool,
metadata: cognito.UserPoolIdentityProviderSamlMetadata.url('https://my-metadata-url.com'),
});
Initializer
new UserPoolIdentityProviderSaml(scope: Construct, id: string, props: UserPoolIdentityProviderSamlProps)
Parameters
- scope
Construct
- id
string
- props
User
Pool Identity Provider Saml Props
Construct Props
Name | Type | Description |
---|---|---|
metadata | User | The SAML metadata. |
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. |
encrypted | boolean | Whether to require encrypted SAML assertions from IdP. |
identifiers? | string[] | Identifiers. |
idp | boolean | Whether to enable IdP-initiated SAML auth flows. |
idp | boolean | Whether to enable the "Sign-out flow" feature. |
name? | string | The name of the provider. |
request | Signing | The signing algorithm for SAML requests. |
metadata
Type:
User
The SAML metadata.
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.
encryptedResponses?
Type:
boolean
(optional, default: false)
Whether to require encrypted SAML assertions from IdP.
identifiers?
Type:
string[]
(optional, default: no identifiers used)
Identifiers.
Identifiers can be used to redirect users to the correct IdP in multitenant apps.
idpInitiated?
Type:
boolean
(optional, default: false)
Whether to enable IdP-initiated SAML auth flows.
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.
requestSigningAlgorithm?
Type:
Signing
(optional, default: don't sign requests)
The signing algorithm for SAML requests.
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
node | Node | The tree node. |
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:
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
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
to | Returns a string representation of this construct. |
protected configure |
applyRemovalPolicy(policy)
public 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
).
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected configureAttributeMapping()
protected configureAttributeMapping(): any
Returns
any