:doc:`ServiceResource <index>` / Action / create_saml_provider

********************
create_saml_provider
********************



.. py:method:: IAM.ServiceResource.create_saml_provider(**kwargs)

  

  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.

   

  .. note::

    

    This operation requires `Signature Version 4 <https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html>`__.

    

   

  For more information, see `Enabling SAML 2.0 federated users to access the Amazon Web Services Management Console <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-saml.html>`__ and `About SAML 2.0-based federation <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html>`__ in the *IAM User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateSAMLProvider>`_  


  **Request Syntax**
  ::

    saml_provider = iam.create_saml_provider(
        SAMLMetadataDocument='string',
        Name='string',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        AssertionEncryptionMode='Required'|'Allowed',
        AddPrivateKey='string'
    )
    
  :type SAMLMetadataDocument: string
  :param SAMLMetadataDocument: **[REQUIRED]** 

    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 <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html>`__ in the *IAM User Guide*

    

  
  :type Name: string
  :param Name: **[REQUIRED]** 

    The name of the provider to create.

     

    This parameter allows (through its `regex pattern <http://wikipedia.org/wiki/regex>`__) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

    

  
  :type Tags: list
  :param 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 <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html>`__ in the *IAM User Guide*.

     

    .. note::

      

      If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.

      

    

  
    - *(dict) --* 

      A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see `Tagging IAM resources <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html>`__ in the *IAM User Guide*.

      

    
      - **Key** *(string) --* **[REQUIRED]** 

        The key name that can be used to look up or retrieve the associated value. For example, ``Department`` or ``Cost Center`` are common choices.

        

      
      - **Value** *(string) --* **[REQUIRED]** 

        The value associated with this tag. For example, tags with a key name of ``Department`` could have values such as ``Human Resources``, ``Accounting``, and ``Support``. Tags with a key name of ``Cost Center`` might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.

        

      
    

  :type AssertionEncryptionMode: string
  :param AssertionEncryptionMode: 

    Specifies the encryption setting for the SAML provider.

    

  
  :type AddPrivateKey: string
  :param 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.

    

  
  
  :rtype: :py:class:`iam.SamlProvider`
  :returns: SamlProvider resource
  