Skip to content

create_challenge async

create_challenge(
    connector_arn: ConnectorArn,
    *,
    config_overrides: Optional[AsyncPcaConnectorScepClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[Tags] = None,
) -> CreateChallengeResponse

For general-purpose connectors. Creates a challenge password for the specified connector. The SCEP protocol uses a challenge password to authenticate a request before issuing a certificate from a certificate authority (CA). Your SCEP clients include the challenge password as part of their certificate request to Connector for SCEP. To retrieve the connector Amazon Resource Names (ARNs) for the connectors in your account, call ListConnectors.

To create additional challenge passwords for the connector, call CreateChallenge again. We recommend frequently rotating your challenge passwords.

Parameters:

  • connector_arn (ConnectorArn) –

    The Amazon Resource Name (ARN) of the connector that you want to create a challenge for.

  • client_token (Optional[ClientToken], default: None ) –

    Custom string that can be used to distinguish between calls to the CreateChallenge action. Client tokens for CreateChallenge time out after five minutes. Therefore, if you call CreateChallenge multiple times with the same client token within five minutes, Connector for SCEP recognizes that you are requesting only one challenge and will only respond with one. If you change the client token for each call, Connector for SCEP recognizes that you are requesting multiple challenge passwords.

  • tags (Optional[Tags], default: None ) –

    The key-value pairs to associate with the resource.

Raises:

  • AccessDeniedException –

    You can receive this error if you attempt to perform an operation and you don't have the required permissions. This can be caused by insufficient permissions in policies attached to your Amazon Web Services Identity and Access Management (IAM) principal. It can also happen because of restrictions in place from an Amazon Web Services Organizations service control policy (SCP) that affects your Amazon Web Services account.

  • BadRequestException –

    The request is malformed or contains an error such as an invalid parameter value or a missing required parameter.

  • ConflictException –

    This request can't be completed for one of the following reasons because the requested resource was being concurrently modified by another request.

  • InternalServerException –

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

  • ResourceNotFoundException –

    The operation tried to access a nonexistent resource. The resource might be incorrectly specified, or it might have a status other than ACTIVE.

  • ServiceQuotaExceededException –

    The request would cause a service quota to be exceeded.

  • ThrottlingException –

    The limit on the number of requests per second was exceeded.

  • ValidationException –

    An input validation error occurred. For example, invalid characters in a name tag, or an invalid pagination token.

  • UnknownServiceError –

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

Source code in docs_src/capo_pca_connector_scep/_services/async_pca_connector_scep.py
async def create_challenge(
    self,
    connector_arn: "capo_pca_connector_scep.types.connector_arn.ConnectorArn",
    *,
    config_overrides: Optional[AsyncPcaConnectorScepClientConfig] = None,
    client_token: Optional[
        "capo_pca_connector_scep.types.client_token.ClientToken"
    ] = None,
    tags: Optional["capo_pca_connector_scep.types.tags.Tags"] = None,
) -> "capo_pca_connector_scep.types.create_challenge_response.CreateChallengeResponse":
    """<p>For general-purpose connectors. Creates a <i>challenge password</i> for the specified connector. The SCEP protocol uses a challenge password to authenticate a request before issuing a certificate from a certificate authority (CA). Your SCEP clients include the challenge password as part of their certificate request to Connector for SCEP. To retrieve the connector Amazon Resource Names (ARNs) for the connectors in your account, call <a href="https://docs.aws.amazon.com/pca-connector-scep/latest/APIReference/API_ListConnectors.html">ListConnectors</a>.</p> <p>To create additional challenge passwords for the connector, call <code>CreateChallenge</code> again. We recommend frequently rotating your challenge passwords.</p>

    Args:
        connector_arn: <p>The Amazon Resource Name (ARN) of the connector that you want to create a challenge for.</p>
        client_token: <p>Custom string that can be used to distinguish between calls to the <a href="https://docs.aws.amazon.com/pca-connector-scep/latest/APIReference/API_CreateChallenge.html">CreateChallenge</a> action. Client tokens for <code>CreateChallenge</code> time out after five minutes. Therefore, if you call <code>CreateChallenge</code> multiple times with the same client token within five minutes, Connector for SCEP recognizes that you are requesting only one challenge and will only respond with one. If you change the client token for each call, Connector for SCEP recognizes that you are requesting multiple challenge passwords.</p>
        tags: <p>The key-value pairs to associate with the resource.</p>

    Raises:
        capo_pca_connector_scep.errors.access_denied_exception.AccessDeniedException: <p>You can receive this error if you attempt to perform an operation and you don't have the required permissions. This can be caused by insufficient permissions in policies attached to your Amazon Web Services Identity and Access Management (IAM) principal. It can also happen because of restrictions in place from an Amazon Web Services Organizations service control policy (SCP) that affects your Amazon Web Services account.</p>
        capo_pca_connector_scep.errors.bad_request_exception.BadRequestException: <p>The request is malformed or contains an error such as an invalid parameter value or a missing required parameter.</p>
        capo_pca_connector_scep.errors.conflict_exception.ConflictException: <p>This request can't be completed for one of the following reasons because the requested resource was being concurrently modified by another request.</p>
        capo_pca_connector_scep.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
        capo_pca_connector_scep.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a nonexistent resource. The resource might be incorrectly specified, or it might have a status other than <code>ACTIVE</code>.</p>
        capo_pca_connector_scep.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would cause a service quota to be exceeded.</p>
        capo_pca_connector_scep.errors.throttling_exception.ThrottlingException: <p>The limit on the number of requests per second was exceeded.</p>
        capo_pca_connector_scep.errors.validation_exception.ValidationException: <p>An input validation error occurred. For example, invalid characters in a name tag, or an invalid pagination token.</p>
        capo_pca_connector_scep.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_pca_connector_scep.types.create_challenge_request.CreateChallengeRequest]",
    ) -> AsyncOperationResponse[
        "capo_pca_connector_scep.types.create_challenge_response.CreateChallengeResponse"
    ]:
        import capo_pca_connector_scep._operations.pca_connector_scep.create_challenge

        (
            output,
            http_response,
        ) = await capo_pca_connector_scep._operations.pca_connector_scep.create_challenge.async_create_challenge(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_pca_connector_scep.types.create_challenge_response.CreateChallengeResponse",
    ) -> dict[str, Any]:
        import capo_pca_connector_scep.types.create_challenge_response

        return capo_pca_connector_scep.types.create_challenge_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateChallenge", redact_output=_redact_output),
    )
    input_: capo_pca_connector_scep.types.create_challenge_request.CreateChallengeRequest = {
        "connector_arn": connector_arn
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

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