Enables the outbound identity federation feature for your Amazon Web Services account. When enabled, IAM principals in your account can use the GetWebIdentityToken API to obtain JSON Web Tokens (JWTs) for secure authentication with external services. This operation also generates a unique issuer URL for your Amazon Web Services account.
Raises:
-
FeatureEnabledException
–
The request failed because outbound identity federation is already enabled for your Amazon Web Services account. You cannot enable the feature multiple times. To fetch the current configuration (including the unique issuer URL), use the GetOutboundWebIdentityFederationInfo operation.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_iam/_services/iam.py
| def enable_outbound_web_identity_federation(
self, *, config_overrides: Optional[IAMClientConfig] = None
) -> "capo_iam.types.enable_outbound_web_identity_federation_response.EnableOutboundWebIdentityFederationResponse":
"""<p>Enables the outbound identity federation feature for your Amazon Web Services account. When enabled, IAM principals in your account can use the <code>GetWebIdentityToken</code> API to obtain JSON Web Tokens (JWTs) for secure authentication with external services. This operation also generates a unique issuer URL for your Amazon Web Services account. </p>
Raises:
capo_iam.errors.feature_enabled_exception.FeatureEnabledException: <p>The request failed because outbound identity federation is already enabled for your Amazon Web Services account. You cannot enable the feature multiple times. To fetch the current configuration (including the unique issuer URL), use the <code>GetOutboundWebIdentityFederationInfo</code> operation.</p>
capo_iam.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[None]",
) -> OperationResponse[
"capo_iam.types.enable_outbound_web_identity_federation_response.EnableOutboundWebIdentityFederationResponse"
]:
import capo_iam._operations.aws_identity_management_v20100508.enable_outbound_web_identity_federation
output, http_response = (
capo_iam._operations.aws_identity_management_v20100508.enable_outbound_web_identity_federation.enable_outbound_web_identity_federation(
req.options
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("EnableOutboundWebIdentityFederation")
)
response = execute_pipeline(
OperationRequest(input=None, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|