Back to product page

LoginChallenge callback


Called when server requests a response to login challenge.

Syntax

  • C
void (*LoginChallenge)(void *Sftp, char *Challenge, char **Response);
The LoginChallenge(void *Sftp,char *Challenge,char **Response) syntax has these parts:
void *SftpHandle of the created Sftp instance.
char *ChallengeHolds the challenge expression provided by the server.
char **ResponseValue 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.

Platforms

Windows