Transfer / Client / test_identity_provider
test_identity_provider#
- Transfer.Client.test_identity_provider(**kwargs)#
If the
IdentityProviderType
of a file transfer protocol-enabled server isAWS_DIRECTORY_SERVICE
orAPI_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
andUserName
parameters are required. TheServerProtocol
,SourceIp
, andUserPassword
are all optional.Note the following:
You cannot use
TestIdentityProvider
if theIdentityProviderType
of your server isSERVICE_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).
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)
Applicability Statement 2 (AS2)
SourceIp (string) – The source IP address of the account to be tested.
UserName (string) –
[REQUIRED]
The name of the account to be tested.
UserPassword (string) – The password of the 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 or your Lambda function.
StatusCode (integer) –
The HTTP status code that is the response from your API Gateway or your Lambda function.
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