Skip to content

revoke_o_auth2_token_with_iam async

revoke_o_auth2_token_with_iam(
    token: RevocationToken,
    *,
    config_overrides: Optional[AsyncSigninClientConfig] = None,
) -> RevokeOAuth2TokenWithIAMResponse

Revokes an OAuth 2.0 refresh token and its associated token chain.

Parameters:

  • token (RevocationToken) –

    The refresh token to revoke. Must be a refresh token issued by AWS Sign-In. Access tokens are not accepted for revocation.

Raises:

Source code in docs_src/capo_signin/_services/async_signin.py
async def revoke_o_auth2_token_with_iam(
    self,
    token: "capo_signin.types.revocation_token.RevocationToken",
    *,
    config_overrides: Optional[AsyncSigninClientConfig] = None,
) -> "capo_signin.types.revoke_o_auth2_token_with_iam_response.RevokeOAuth2TokenWithIAMResponse":
    """Revokes an OAuth 2.0 refresh token and its associated token chain.

    Args:
        token: The refresh token to revoke. Must be a refresh token issued by AWS Sign-In. Access tokens are not accepted for revocation.

    Raises:
        capo_signin.errors.access_denied_exception.AccessDeniedException: You do not have sufficient access to perform this action.
        capo_signin.errors.internal_server_exception.InternalServerException: The request failed because of an internal server error.
        capo_signin.errors.too_many_requests_error.TooManyRequestsError: The request failed because you exceeded the request rate limit for this operation.
        capo_signin.errors.validation_exception.ValidationException: The request failed because it contains a malformed, missing, or invalid parameter.
        capo_signin.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_signin.types.revoke_o_auth2_token_with_iam_request.RevokeOAuth2TokenWithIAMRequest]",
    ) -> AsyncOperationResponse[
        "capo_signin.types.revoke_o_auth2_token_with_iam_response.RevokeOAuth2TokenWithIAMResponse"
    ]:
        import capo_signin._operations.signin.revoke_o_auth2_token_with_iam

        (
            output,
            http_response,
        ) = await capo_signin._operations.signin.revoke_o_auth2_token_with_iam.async_revoke_o_auth2_token_with_iam(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_signin.types.revoke_o_auth2_token_with_iam_request.RevokeOAuth2TokenWithIAMRequest",
    ) -> dict[str, Any]:
        import capo_signin.types.revoke_o_auth2_token_with_iam_request

        return capo_signin.types.revoke_o_auth2_token_with_iam_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("RevokeOAuth2TokenWithIAM", redact_input=_redact_input),
    )
    input_: capo_signin.types.revoke_o_auth2_token_with_iam_request.RevokeOAuth2TokenWithIAMRequest = {
        "token": token
    }

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