Skip to content

get_identity_center_auth_token async

get_identity_center_auth_token(
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    cluster_ids: Optional[ClusterIdentifierList] = None,
) -> GetIdentityCenterAuthTokenResponse

Generates an encrypted authentication token that propagates the caller's Amazon Web Services IAM Identity Center identity to Amazon Redshift clusters. This API extracts the Amazon Web Services IAM Identity Center identity from enhanced credentials and creates a secure token that Amazon Redshift drivers can use for authentication.

The token is encrypted using Key Management Service (KMS) and can only be decrypted by the specified Amazon Redshift clusters. The token contains the caller's Amazon Web Services IAM Identity Center identity information and is valid for a limited time period.

This API is exclusively for use with Amazon Web Services IAM Identity Center enhanced credentials. If the caller is not using enhanced credentials with embedded Amazon Web Services IAM Identity Center identity, the API will return an error.

Parameters:

  • cluster_ids (Optional[ClusterIdentifierList], default: None ) –

    A list of cluster identifiers that the generated token can be used with. The token will be scoped to only allow authentication to the specified clusters.

    Constraints:

    • ClusterIds must contain at least 1 cluster identifier.

    • ClusterIds can hold a maximum of 20 cluster identifiers.

    • Cluster identifiers must be 1 to 63 characters in length.

    • The characters accepted for cluster identifiers are the following:

      • Alphanumeric characters

      • Hyphens

    • Cluster identifiers must start with a letter.

    • Cluster identifiers can't end with a hyphen or contain two consecutive hyphens.

Raises:

Source code in docs_src/capo_redshift/_services/async_redshift.py
async def get_identity_center_auth_token(
    self,
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    cluster_ids: Optional[
        "capo_redshift.types.cluster_identifier_list.ClusterIdentifierList"
    ] = None,
) -> "capo_redshift.types.get_identity_center_auth_token_response.GetIdentityCenterAuthTokenResponse":
    """<p>Generates an encrypted authentication token that propagates the caller's Amazon Web Services IAM Identity Center identity to Amazon Redshift clusters. This API extracts the Amazon Web Services IAM Identity Center identity from enhanced credentials and creates a secure token that Amazon Redshift drivers can use for authentication.</p> <p>The token is encrypted using Key Management Service (KMS) and can only be decrypted by the specified Amazon Redshift clusters. The token contains the caller's Amazon Web Services IAM Identity Center identity information and is valid for a limited time period.</p> <p>This API is exclusively for use with Amazon Web Services IAM Identity Center enhanced credentials. If the caller is not using enhanced credentials with embedded Amazon Web Services IAM Identity Center identity, the API will return an error.</p>

    Args:
        cluster_ids: <p>A list of cluster identifiers that the generated token can be used with. The token will be scoped to only allow authentication to the specified clusters.</p> <p>Constraints:</p> <ul> <li> <p> <code>ClusterIds</code> must contain at least 1 cluster identifier.</p> </li> <li> <p> <code>ClusterIds</code> can hold a maximum of 20 cluster identifiers.</p> </li> <li> <p>Cluster identifiers must be 1 to 63 characters in length.</p> </li> <li> <p>The characters accepted for cluster identifiers are the following:</p> <ul> <li> <p>Alphanumeric characters</p> </li> <li> <p>Hyphens</p> </li> </ul> </li> <li> <p>Cluster identifiers must start with a letter.</p> </li> <li> <p>Cluster identifiers can't end with a hyphen or contain two consecutive hyphens.</p> </li> </ul>

    Raises:
        capo_redshift.errors.cluster_not_found_fault.ClusterNotFoundFault: <p>The <code>ClusterIdentifier</code> parameter does not refer to an existing cluster. </p>
        capo_redshift.errors.invalid_cluster_state_fault.InvalidClusterStateFault: <p>The specified cluster is not in the <code>available</code> state. </p>
        capo_redshift.errors.redshift_invalid_parameter_fault.RedshiftInvalidParameterFault: <p>The request contains one or more invalid parameters. This error occurs when required parameters are missing, parameter values are outside acceptable ranges, or parameter formats are incorrect.</p>
        capo_redshift.errors.unsupported_operation_fault.UnsupportedOperationFault: <p>The requested operation isn't supported.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_redshift.types.get_identity_center_auth_token_request.GetIdentityCenterAuthTokenRequest]",
    ) -> AsyncOperationResponse[
        "capo_redshift.types.get_identity_center_auth_token_response.GetIdentityCenterAuthTokenResponse"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.get_identity_center_auth_token

        (
            output,
            http_response,
        ) = await capo_redshift._operations.redshift_service_version20121201.get_identity_center_auth_token.async_get_identity_center_auth_token(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_redshift.types.get_identity_center_auth_token_response.GetIdentityCenterAuthTokenResponse",
    ) -> dict[str, Any]:
        import capo_redshift.types.get_identity_center_auth_token_response

        return capo_redshift.types.get_identity_center_auth_token_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GetIdentityCenterAuthToken", redact_output=_redact_output
        ),
    )
    input_: capo_redshift.types.get_identity_center_auth_token_request.GetIdentityCenterAuthTokenRequest = {}
    if cluster_ids is not None:
        input_["cluster_ids"] = cluster_ids

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