Skip to content

test_identity_provider

test_identity_provider(
    server_id: ServerId,
    user_name: UserName,
    *,
    config_overrides: Optional[TransferClientConfig] = None,
    server_protocol: Optional[Protocol] = None,
    source_ip: Optional[SourceIp] = None,
    user_password: Optional[UserPassword] = None,
) -> TestIdentityProviderResponse

If the IdentityProviderType of a file transfer protocol-enabled server is AWS_DIRECTORY_SERVICE or API_Gateway, tests whether your identity provider is set up successfully. We highly recommend that you call this operation to test your authentication method as soon as you create your server. By doing so, you can troubleshoot issues with the identity provider integration to ensure that your users can successfully use the service.

The ServerId and UserName parameters are required. The ServerProtocol, SourceIp, and UserPassword are all optional.

Note the following:

  • You cannot use TestIdentityProvider if the IdentityProviderType of your server is SERVICE_MANAGED.

  • TestIdentityProvider does not work with keys: it only accepts passwords.

  • TestIdentityProvider can test the password operation for a custom Identity Provider that handles keys and passwords.

  • If you provide any incorrect values for any parameters, the Response field is empty.

  • If you provide a server ID for a server that uses service-managed users, you get an error:

    An error occurred (InvalidRequestException) when calling the TestIdentityProvider operation: s-server-ID not configured for external auth

  • If you enter a Server ID for the --server-id parameter that does not identify an actual Transfer server, you receive the following error:

    An error occurred (ResourceNotFoundException) when calling the TestIdentityProvider operation: Unknown server.

    It is possible your sever is in a different region. You can specify a region by adding the following: --region region-code, such as --region us-east-2 to specify a server in US East (Ohio).

Parameters:

  • server_id (ServerId) –

    A system-assigned identifier for a specific server. That server's user authentication method is tested with a user name and password.

  • server_protocol (Optional[Protocol], default: None ) –

    The type of file transfer protocol to be tested.

    The available protocols are:

    • Secure Shell (SSH) File Transfer Protocol (SFTP)

    • File Transfer Protocol Secure (FTPS)

    • File Transfer Protocol (FTP)

    • Applicability Statement 2 (AS2)

  • source_ip (Optional[SourceIp], default: None ) –

    The source IP address of the account to be tested.

  • user_name (UserName) –

    The name of the account to be tested.

  • user_password (Optional[UserPassword], default: None ) –

    The password of the account to be tested.

Raises:

Source code in docs_src/capo_transfer/_services/transfer.py
def test_identity_provider(
    self,
    server_id: "capo_transfer.types.server_id.ServerId",
    user_name: "capo_transfer.types.user_name.UserName",
    *,
    config_overrides: Optional[TransferClientConfig] = None,
    server_protocol: Optional["capo_transfer.types.protocol.Protocol"] = None,
    source_ip: Optional["capo_transfer.types.source_ip.SourceIp"] = None,
    user_password: Optional[
        "capo_transfer.types.user_password.UserPassword"
    ] = None,
) -> "capo_transfer.types.test_identity_provider_response.TestIdentityProviderResponse":
    """<p>If the <code>IdentityProviderType</code> of a file transfer protocol-enabled server is <code>AWS_DIRECTORY_SERVICE</code> or <code>API_Gateway</code>, tests whether your identity provider is set up successfully. We highly recommend that you call this operation to test your authentication method as soon as you create your server. By doing so, you can troubleshoot issues with the identity provider integration to ensure that your users can successfully use the service.</p> <p> The <code>ServerId</code> and <code>UserName</code> parameters are required. The <code>ServerProtocol</code>, <code>SourceIp</code>, and <code>UserPassword</code> are all optional. </p> <p>Note the following:</p> <ul> <li> <p> You cannot use <code>TestIdentityProvider</code> if the <code>IdentityProviderType</code> of your server is <code>SERVICE_MANAGED</code>.</p> </li> <li> <p> <code>TestIdentityProvider</code> does not work with keys: it only accepts passwords.</p> </li> <li> <p> <code>TestIdentityProvider</code> can test the password operation for a custom Identity Provider that handles keys and passwords.</p> </li> <li> <p> If you provide any incorrect values for any parameters, the <code>Response</code> field is empty. </p> </li> <li> <p> If you provide a server ID for a server that uses service-managed users, you get an error: </p> <p> <code> An error occurred (InvalidRequestException) when calling the TestIdentityProvider operation: s-<i>server-ID</i> not configured for external auth </code> </p> </li> <li> <p> If you enter a Server ID for the <code>--server-id</code> parameter that does not identify an actual Transfer server, you receive the following error: </p> <p> <code>An error occurred (ResourceNotFoundException) when calling the TestIdentityProvider operation: Unknown server</code>. </p> <p>It is possible your sever is in a different region. You can specify a region by adding the following: <code>--region region-code</code>, such as <code>--region us-east-2</code> to specify a server in <b>US East (Ohio)</b>.</p> </li> </ul>

    Args:
        server_id: <p>A system-assigned identifier for a specific server. That server's user authentication method is tested with a user name and password.</p>
        server_protocol: <p>The type of file transfer protocol to be tested.</p> <p>The available protocols are:</p> <ul> <li> <p>Secure Shell (SSH) File Transfer Protocol (SFTP)</p> </li> <li> <p>File Transfer Protocol Secure (FTPS)</p> </li> <li> <p>File Transfer Protocol (FTP)</p> </li> <li> <p>Applicability Statement 2 (AS2)</p> </li> </ul>
        source_ip: <p>The source IP address of the account to be tested.</p>
        user_name: <p>The name of the account to be tested.</p>
        user_password: <p>The password of the account to be tested.</p>

    Raises:
        capo_transfer.errors.internal_service_error.InternalServiceError: <p>This exception is thrown when an error occurs in the Transfer Family service.</p>
        capo_transfer.errors.invalid_request_exception.InvalidRequestException: <p>This exception is thrown when the client submits a malformed request.</p>
        capo_transfer.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when a resource is not found by the Amazon Web ServicesTransfer Family service.</p>
        capo_transfer.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request has failed because the Amazon Web ServicesTransfer Family service is not available.</p>
        capo_transfer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_transfer.types.test_identity_provider_request.TestIdentityProviderRequest]",
    ) -> OperationResponse[
        "capo_transfer.types.test_identity_provider_response.TestIdentityProviderResponse"
    ]:
        import capo_transfer._operations.transfer_service.test_identity_provider

        output, http_response = (
            capo_transfer._operations.transfer_service.test_identity_provider.test_identity_provider(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_transfer.types.test_identity_provider_request.TestIdentityProviderRequest",
    ) -> dict[str, Any]:
        import capo_transfer.types.test_identity_provider_request

        return capo_transfer.types.test_identity_provider_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("TestIdentityProvider", redact_input=_redact_input),
    )
    input_: capo_transfer.types.test_identity_provider_request.TestIdentityProviderRequest = {
        "server_id": server_id,
        "user_name": user_name,
    }
    if server_protocol is not None:
        input_["server_protocol"] = server_protocol
    if source_ip is not None:
        input_["source_ip"] = source_ip
    if user_password is not None:
        input_["user_password"] = user_password

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output