Transfer / Client / test_identity_provider

test_identity_provider#

Transfer.Client.test_identity_provider(**kwargs)#

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

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

  • 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

See also: AWS API Documentation

Request Syntax

response = client.test_identity_provider(
    ServerId='string',
    ServerProtocol='SFTP'|'FTP'|'FTPS'|'AS2',
    SourceIp='string',
    UserName='string',
    UserPassword='string'
)
Parameters:
  • ServerId (string) –

    [REQUIRED]

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

  • ServerProtocol (string) –

    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)

  • SourceIp (string) – The source IP address of the user account to be tested.

  • UserName (string) –

    [REQUIRED]

    The name of the user account to be tested.

  • UserPassword (string) – The password of the user account to be tested.

Return type:

dict

Returns:

Response Syntax

{
    'Response': 'string',
    'StatusCode': 123,
    'Message': 'string',
    'Url': 'string'
}

Response Structure

  • (dict) –

    • Response (string) –

      The response that is returned from your API Gateway.

    • StatusCode (integer) –

      The HTTP status code that is the response from your API Gateway.

    • Message (string) –

      A message that indicates whether the test was successful or not.

      Note

      If an empty string is returned, the most likely cause is that the authentication failed due to an incorrect username or password.

    • Url (string) –

      The endpoint of the service used to authenticate a user.

Exceptions

  • Transfer.Client.exceptions.ServiceUnavailableException

  • Transfer.Client.exceptions.InternalServiceError

  • Transfer.Client.exceptions.InvalidRequestException

  • Transfer.Client.exceptions.ResourceNotFoundException