Skip to content
v2.278.0

UserPoolIdentityProviderSamlProps Struct ​

Properties to initialize UserPoolIdentityProviderSaml.

Example ​

ts
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'),
});
python
userpool = cognito.UserPool(self, "Pool")

# specify the metadata as a file content
cognito.UserPoolIdentityProviderSaml(self, "userpoolIdpFile",
    user_pool=userpool,
    metadata=cognito.UserPoolIdentityProviderSamlMetadata.file("my-file-contents"),
    # Whether to require encrypted SAML assertions from IdP
    encrypted_responses=True,
    # The signing algorithm for the SAML requests
    request_signing_algorithm=cognito.SigningAlgorithm.RSA_SHA256,
    # Enable IdP initiated SAML auth flow
    idp_initiated=True
)

# specify the metadata as a URL
cognito.UserPoolIdentityProviderSaml(self, "userpoolidpUrl",
    user_pool=userpool,
    metadata=cognito.UserPoolIdentityProviderSamlMetadata.url("https://my-metadata-url.com")
)
java
UserPool userpool = new UserPool(this, "Pool");

// specify the metadata as a file content
// specify the metadata as a file content
UserPoolIdentityProviderSaml.Builder.create(this, "userpoolIdpFile")
        .userPool(userpool)
        .metadata(UserPoolIdentityProviderSamlMetadata.file("my-file-contents"))
        // Whether to require encrypted SAML assertions from IdP
        .encryptedResponses(true)
        // The signing algorithm for the SAML requests
        .requestSigningAlgorithm(SigningAlgorithm.RSA_SHA256)
        // Enable IdP initiated SAML auth flow
        .idpInitiated(true)
        .build();

// specify the metadata as a URL
// specify the metadata as a URL
UserPoolIdentityProviderSaml.Builder.create(this, "userpoolidpUrl")
        .userPool(userpool)
        .metadata(UserPoolIdentityProviderSamlMetadata.url("https://my-metadata-url.com"))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var userpool = new UserPool(this, "Pool");

// specify the metadata as a file content
// specify the metadata as a file content
new UserPoolIdentityProviderSaml(this, "userpoolIdpFile", new UserPoolIdentityProviderSamlProps {
    UserPool = userpool,
    Metadata = UserPoolIdentityProviderSamlMetadata.File("my-file-contents"),
    // Whether to require encrypted SAML assertions from IdP
    EncryptedResponses = true,
    // The signing algorithm for the SAML requests
    RequestSigningAlgorithm = SigningAlgorithm.RSA_SHA256,
    // Enable IdP initiated SAML auth flow
    IdpInitiated = true
});

// specify the metadata as a URL
// specify the metadata as a URL
new UserPoolIdentityProviderSaml(this, "userpoolidpUrl", new UserPoolIdentityProviderSamlProps {
    UserPool = userpool,
    Metadata = UserPoolIdentityProviderSamlMetadata.Url("https://my-metadata-url.com")
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
userpool := cognito.NewUserPool(this, jsii.String("Pool"))

// specify the metadata as a file content
// specify the metadata as a file content
cognito.NewUserPoolIdentityProviderSaml(this, jsii.String("userpoolIdpFile"), &UserPoolIdentityProviderSamlProps{
	UserPool: userpool,
	Metadata: cognito.UserPoolIdentityProviderSamlMetadata_File(jsii.String("my-file-contents")),
	// Whether to require encrypted SAML assertions from IdP
	EncryptedResponses: jsii.Boolean(true),
	// The signing algorithm for the SAML requests
	RequestSigningAlgorithm: cognito.SigningAlgorithm_RSA_SHA256,
	// Enable IdP initiated SAML auth flow
	IdpInitiated: jsii.Boolean(true),
})

// specify the metadata as a URL
// specify the metadata as a URL
cognito.NewUserPoolIdentityProviderSaml(this, jsii.String("userpoolidpUrl"), &UserPoolIdentityProviderSamlProps{
	UserPool: userpool,
	Metadata: cognito.UserPoolIdentityProviderSamlMetadata_Url(jsii.String("https://my-metadata-url.com")),
})

Properties ​

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

Default: no attribute mapping

encryptedResponsesoptionalbooleanencrypted_responsesoptionalboolencryptedResponsesoptionalBooleanEncryptedResponsesoptionalboolEncryptedResponsesoptional*bool = false #
Whether to require encrypted SAML assertions from IdP.
identifiersoptionalstring[]identifiersoptionaltyping.List[str]identifiersoptionalList<String>Identifiersoptionalstring[]Identifiersoptional*[]*string #
Identifiers.

Default: no identifiers used

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

idpInitiatedoptionalbooleanidp_initiatedoptionalboolidpInitiatedoptionalBooleanIdpInitiatedoptionalboolIdpInitiatedoptional*bool = false #
Whether to enable IdP-initiated SAML auth flows.
idpSignoutoptionalbooleanidp_signoutoptionalboolidpSignoutoptionalBooleanIdpSignoutoptionalboolIdpSignoutoptional*bool = false #
Whether to enable the "Sign-out flow" feature.
nameoptionalstringnameoptionalstrnameoptionalStringNameoptionalstringNameoptional*string #
The name of the provider.

Default: the unique ID of the construct

Must be between 3 and 32 characters.

requestSigningAlgorithmoptionalSigningAlgorithmrequest_signing_algorithmoptionalSigningAlgorithmrequestSigningAlgorithmoptionalSigningAlgorithmRequestSigningAlgorithmoptionalSigningAlgorithmRequestSigningAlgorithmoptionalSigningAlgorithm #
The signing algorithm for SAML requests.

Default: don't sign requests

userPoolIUserPooluser_poolIUserPooluserPoolIUserPoolUserPoolIUserPoolUserPoolIUserPool required #
The user pool to which this construct provides identities.