Create a SAML identity provider in IAM
An IAM SAML 2.0 identity provider is an entity in IAM that describes an external
identity provider (IdP) service that supports the SAML 2.0 (Security Assertion Markup Language
2.0)
For more information about this scenario, see SAML 2.0 federation.
You can create and manage an IAM identity provider in the AWS Management Console or with AWS CLI, Tools for Windows PowerShell, or AWS API calls.
After you create a SAML provider, you must create one or more IAM roles. A role is an identity in AWS that doesn't have its own credentials (as a user does). But in this context, a role is dynamically assigned to a federated user that is authenticated by your organization's IdP. The role permits your organization's IdP to request temporary security credentials for access to AWS. The policies assigned to the role determine what the federated users are allowed to do in AWS. To create a role for SAML federation, see Create a role for a third-party identity provider (federation).
Finally, after you create the role, you complete the SAML trust by configuring your IdP with information about AWS and the roles that you want your federated users to use. This is referred to as configuring relying party trust between your IdP and AWS. To configure relying party trust, see Configure your SAML 2.0 IdP with relying party trust and adding claims.
Topics
Prerequisites
Before you can create a SAML identity provider, you must have the following information from your IdP.
-
Get the SAML metadata document from your IdP. This document includes the issuer's name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) that are received from the IdP. To generate the metadata document, use the identity management software provided by your external IdP.
Important
This metadata file includes the issuer name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) received from the IdP. The metadata file must be encoded in UTF-8 format without a byte order mark (BOM). To remove the BOM, you can encode the file as UTF-8 using a text editing tool, such as Notepad++.
The X.509 certificate included as part of the SAML metadata document must use a key size of at least 1024 bits. Also, the X.509 certificate must also be free of any repeated extensions. You can use extensions, but the extensions can only appear once in the certificate. If the X.509 certificate does not meet either condition, IdP creation fails and returns an "Unable to parse metadata" error.
As defined by the SAML V2.0 Metadata Interoperability Profile Version 1.0
, IAM does not evaluate or take action on the expiration of X.509 certificates in SAML metadata documents. If you are concerned about expired X.509 certificates, we recommend monitoring certificate expiration dates and rotating certificates according to your organization’s governance and security policies.
For instructions on how to configure many of the available IdPs to work with AWS, including how to generate the required SAML metadata document, see Integrate third-party SAML solution providers with AWS.
For help with SAML federation, see Troubleshooting SAML federation.
Create and manage an IAM SAML identity provider (console)
You can use the AWS Management Console to create, update, and delete IAM SAML identity providers. For help with SAML federation, see Troubleshooting SAML federation.
To create an IAM SAML identity provider (console)
Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/
. -
In the navigation pane, choose Identity providers and then choose Add provider.
-
For Configure provider, choose SAML.
-
Type a name for the identity provider.
-
For Metadata document, choose Choose file, specify the SAML metadata document that you downloaded in Prerequisites.
-
(Optional) For Add tags you can add key–value pairs to help you identify and organize your IdPs. You can also use tags to control access to AWS resources. To learn more about tagging SAML identity providers, see Tag IAM SAML identity providers.
Choose Add tag. Enter values for each tag key-value pair.
-
Verify the information that you have provided. When you are done, choose Add provider.
-
Assign an IAM role to your identity provider. This role gives external user identities managed by your identity provider permissions to access AWS resources in your account. To learn more about creating roles for identity federation, see Create a role for a third-party identity provider (federation).
Note
SAML IDPs used in a role trust policy must be in the same account that the role is in.
To delete a SAML provider (console)
Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/
. -
In the navigation pane, choose Identity providers.
-
Select the radio button next to the identity provider that you want to delete.
-
Choose Delete. A new window opens.
-
Confirm that you want to delete the provider by typing the word
delete
in the field. Then, choose Delete.
Create and manage an IAM SAML Identity Provider (AWS CLI)
You can use the AWS CLI to create, update, and delete SAML providers. For help with SAML federation, see Troubleshooting SAML federation.
To create an IAM identity provider and upload a metadata document (AWS CLI)
-
Run this command:
aws iam create-saml-provider
To update an IAM SAML identity provider (AWS CLI)
-
Run this command:
aws iam update-saml-provider
To tag an existing IAM identity provider (AWS CLI)
-
Run this command:
aws iam tag-saml-provider
To list tags for existing IAM identity provider (AWS CLI)
-
Run this command:
aws iam list-saml-provider-tags
To remove tags on an existing IAM identity provider (AWS CLI)
-
Run this command:
aws iam untag-saml-provider
To delete an IAM SAML identity provider (AWS CLI)
-
(Optional) To list information for all providers, such as the ARN, creation date, and expiration, run the following command:
-
(Optional) To get information about a specific provider, such as the ARN, creation date, expiration date, encryption settings, and private key information, run the following command:
-
To delete an IAM identity provider, run the following command:
Create and manage an IAM SAML identity provider (AWS API)
You can use the AWS API to create, update, and delete SAML providers. For help with SAML federation, see Troubleshooting SAML federation.
To create an IAM identity provider and upload a metadata document (AWS API)
-
Call this operation:
CreateSAMLProvider
To update an IAM SAML identity provider (AWS API)
-
Call this operation:
UpdateSAMLProvider
To tag an existing IAM identity provider (AWS API)
-
Call this operation:
TagSAMLProvider
To list tags for an existing IAM identity provider (AWS API)
-
Call this operation:
ListSAMLProviderTags
To remove tags on an existing IAM identity provider (AWS API)
-
Call this operation:
UntagSAMLProvider
To delete an IAM identity provider (AWS API)
-
(Optional) To list information for all IdPs, such as the ARN, creation date, and expiration, call the following operation:
-
(Optional) To get information about a specific provider, such as the ARN, creation date, expiration date, encryption settings, and private key information, call the following operation:
-
To delete an IdP, call the following operation:
Next steps
After you create a SAML identity provider, set up the relying party trust with your IdP. You can also use claims from your IdP's authentication response in policies to control access to a role.
-
You must tell the IdP about AWS as a service provider. This is called adding relying party trust between your IdP and AWS. The exact process for adding relying party trust depends on what IdP you're using. For details, see Configure your SAML 2.0 IdP with relying party trust and adding claims.
-
When the IdP sends the response containing the claims to AWS, many of the incoming claims map to AWS context keys. You can use these context keys in IAM policies using the Condition element to control access to a role. For details, see Configure SAML assertions for the authentication response