createSAMLProvider method
Creates an IAM resource that describes an identity provider (IdP) that supports SAML 2.0.
The SAML provider resource that you create with this operation can be used as a principal in an IAM role's trust policy. Such a policy can enable federated users who sign in using the SAML IdP to assume the role. You can create an IAM role that supports Web-based single sign-on (SSO) to the Amazon Web Services Management Console or one that supports API access to Amazon Web Services.
When you create the SAML provider resource, you upload a SAML metadata document that you get from your IdP. That document includes the issuer's name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) that the IdP sends. You must generate the metadata document using the identity management software that is used as your organization's IdP. For more information, see Enabling SAML 2.0 federated users to access the Amazon Web Services Management Console and About SAML 2.0-based federation in the IAM User Guide.
May throw ConcurrentModificationException.
May throw EntityAlreadyExistsException.
May throw InvalidInputException.
May throw LimitExceededException.
May throw ServiceFailureException.
Parameter name :
The name of the provider to create.
This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
Parameter sAMLMetadataDocument :
An XML document generated by an identity provider (IdP) that supports SAML
2.0. The 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. You must generate the
metadata document using the identity management software that is used as
your organization's IdP.
For more information, see About SAML 2.0-based federation in the IAM User Guide
Parameter addPrivateKey :
The private key generated from your external identity provider. The
private key must be a .pem file that uses AES-GCM or AES-CBC encryption
algorithm to decrypt SAML assertions.
Parameter assertionEncryptionMode :
Specifies the encryption setting for the SAML provider.
Parameter tags :
A list of tags that you want to attach to the new IAM SAML provider. Each
tag consists of a key name and an associated value. For more information
about tagging, see Tagging
IAM resources in the IAM User Guide.
Implementation
Future<CreateSAMLProviderResponse> createSAMLProvider({
required String name,
required String sAMLMetadataDocument,
String? addPrivateKey,
AssertionEncryptionModeType? assertionEncryptionMode,
List<Tag>? tags,
}) async {
final $request = <String, String>{
'Name': name,
'SAMLMetadataDocument': sAMLMetadataDocument,
if (addPrivateKey != null) 'AddPrivateKey': addPrivateKey,
if (assertionEncryptionMode != null)
'AssertionEncryptionMode': assertionEncryptionMode.value,
if (tags != null)
if (tags.isEmpty)
'Tags': ''
else
for (var i1 = 0; i1 < tags.length; i1++)
for (var e3 in tags[i1].toQueryMap().entries)
'Tags.member.${i1 + 1}.${e3.key}': e3.value,
};
final $result = await _protocol.send(
$request,
action: 'CreateSAMLProvider',
version: '2010-05-08',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'CreateSAMLProviderResult',
);
return CreateSAMLProviderResponse.fromXml($result);
}