wodSFTP API library - LoginChallenge Callback
    
 

Description

Called when server requests a response to login challenge.


Syntax

void (*LoginChallenge)(void *Sftp, char *Challenge, char **Response);

The LoginChallenge callback syntax has these parts:

Part Description
void *Sftp Handle of the created Sftp instance.
char *Challenge Holdsthe challenge expression provided by the server.
char **Response Value you should provide this as the answer to the challenge.

Remarks

LoginChallenge callback will be called when wodSFTP tries to use Keyboard-Interactive authentication. This type of authentication is selected when you set Authentication = AuthPassword (or AuthAny by default) but password authentication fails. In this case wodSFTP tries Keyboard-Interactive authentication (if it is available on the server) which causes the server to send a 'challenge' request that can be shown on the user's screen and to which you must answer with the proper response in order to become authenticated.

 
Often, the server just sends something like 'please enter your password', but on some configurations this can be any question. For example, the server may request that you enter a one-time-password, or your token ID.
 
NOTE: this callback is called only if you have created instance of SftpEventsStruct structure, and set up its LoginChallenge member to function implementing it.