Skip to content

update_saml_provider async

update_saml_provider(
    saml_provider_arn: arnType,
    *,
    config_overrides: Optional[AsyncIAMClientConfig] = None,
    saml_metadata_document: Optional[SAMLMetadataDocumentType] = None,
    assertion_encryption_mode: Optional[assertionEncryptionModeType] = None,
    add_private_key: Optional[privateKeyType] = None,
    remove_private_key: Optional[privateKeyIdType] = None,
) -> UpdateSAMLProviderResponse

Updates the metadata document, SAML encryption settings, and private keys for an existing SAML provider. To rotate private keys, add your new private key and then remove the old key in a separate request.

Parameters:

  • saml_metadata_document (Optional[SAMLMetadataDocumentType], default: None ) –

    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 IdP.

  • saml_provider_arn (arnType) –

    The Amazon Resource Name (ARN) of the SAML provider to update.

    For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

  • assertion_encryption_mode (Optional[assertionEncryptionModeType], default: None ) –

    Specifies the encryption setting for the SAML provider.

  • add_private_key (Optional[privateKeyType], default: None ) –

    Specifies the new private key 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.

  • remove_private_key (Optional[privateKeyIdType], default: None ) –

    The Key ID of the private key to remove.

Raises:

  • ConcurrentModificationException –

    The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.

  • InvalidInputException –

    The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • LimitExceededException –

    The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.

  • NoSuchEntityException –

    The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ServiceFailureException –

    The request processing has failed because of an unknown error, exception or failure.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_iam/_services/async_iam.py
async def update_saml_provider(
    self,
    saml_provider_arn: "capo_iam.types.arn_type.arnType",
    *,
    config_overrides: Optional[AsyncIAMClientConfig] = None,
    saml_metadata_document: Optional[
        "capo_iam.types.saml_metadata_document_type.SAMLMetadataDocumentType"
    ] = None,
    assertion_encryption_mode: Optional[
        "capo_iam.types.assertion_encryption_mode_type.assertionEncryptionModeType"
    ] = None,
    add_private_key: Optional[
        "capo_iam.types.private_key_type.privateKeyType"
    ] = None,
    remove_private_key: Optional[
        "capo_iam.types.private_key_id_type.privateKeyIdType"
    ] = None,
) -> "capo_iam.types.update_saml_provider_response.UpdateSAMLProviderResponse":
    """<p>Updates the metadata document, SAML encryption settings, and private keys for an existing SAML provider. To rotate private keys, add your new private key and then remove the old key in a separate request.</p>

    Args:
        saml_metadata_document: <p>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 IdP.</p>
        saml_provider_arn: <p>The Amazon Resource Name (ARN) of the SAML provider to update.</p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
        assertion_encryption_mode: <p>Specifies the encryption setting for the SAML provider.</p>
        add_private_key: <p>Specifies the new private key 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.</p>
        remove_private_key: <p>The Key ID of the private key to remove.</p>

    Raises:
        capo_iam.errors.concurrent_modification_exception.ConcurrentModificationException: <p>The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.</p>
        capo_iam.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because an invalid or out-of-range value was supplied for an input parameter.</p>
        capo_iam.errors.limit_exceeded_exception.LimitExceededException: <p>The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.</p>
        capo_iam.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.</p>
        capo_iam.errors.service_failure_exception.ServiceFailureException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_iam.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iam.types.update_saml_provider_request.UpdateSAMLProviderRequest]",
    ) -> AsyncOperationResponse[
        "capo_iam.types.update_saml_provider_response.UpdateSAMLProviderResponse"
    ]:
        import capo_iam._operations.aws_identity_management_v20100508.update_saml_provider

        (
            output,
            http_response,
        ) = await capo_iam._operations.aws_identity_management_v20100508.update_saml_provider.async_update_saml_provider(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_iam.types.update_saml_provider_request.UpdateSAMLProviderRequest",
    ) -> dict[str, Any]:
        import capo_iam.types.update_saml_provider_request

        return capo_iam.types.update_saml_provider_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateSAMLProvider", redact_input=_redact_input),
    )
    input_: capo_iam.types.update_saml_provider_request.UpdateSAMLProviderRequest = {
        "saml_provider_arn": saml_provider_arn
    }
    if saml_metadata_document is not None:
        input_["saml_metadata_document"] = saml_metadata_document
    if assertion_encryption_mode is not None:
        input_["assertion_encryption_mode"] = assertion_encryption_mode
    if add_private_key is not None:
        input_["add_private_key"] = add_private_key
    if remove_private_key is not None:
        input_["remove_private_key"] = remove_private_key

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output