# UserPoolIdentityProviderSamlMetadata

Metadata for a SAML user pool identity provider.

- Source: [`aws-cognito/lib/user-pool-idps/saml.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-cognito/lib/user-pool-idps/saml.ts#L93)
- Type last changed: v2.42.0 · 16 Sep 2022

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

## Properties

- `metadataContent`: string — A URL hosting SAML metadata, or the content of a file containing SAML metadata.

- `metadataType`: [UserPoolIdentityProviderSamlMetadataType](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.UserPoolIdentityProviderSamlMetadataType.html) — The type of metadata, either a URL or file content.

## Methods

- `file(fileContent: string): UserPoolIdentityProviderSamlMetadata // chainable` (static) — Specify SAML metadata via the contents of a file.

- `url(url: string): UserPoolIdentityProviderSamlMetadata // chainable` (static) — Specify SAML metadata via a URL.
