keyboard-interactive authentication - WeOnlyDo Discussion board

keyboard-interactive authentication (General questions)

by Jeff, Friday, December 16, 2005, 21:16 (6916 days ago)

Hello, I have a general question about using keyboard-interactive authentication. At this point my C++ app is using password authentication and everything works fine. I now need to support kyb-int auth, so to test I switched put_Authentication(1) to put_Authentication(4), but as soon as I call the Connect() method, it throws an exception telling me invalid login/pwd. I used the same login/pwd that works in the other authentication mode, so what might be wrong? Do you have any samples of this mode of authentication?


Thanks

Re: keyboard-interactive authentication

by wodSupport, Friday, December 16, 2005, 21:20 (6916 days ago) @ Jeff

Jeff,

try to look at LoginChallenge event - that should do the trick. That is where server sends the challenge and you should send your response back.

Kreso

Re: keyboard-interactive authentication

by Jeff, Wednesday, December 28, 2005, 19:11 (6904 days ago) @ wodSupport

Hello - I have tried to handle the LoginChallenge event as you specified but it does not seem to get fired. I slightly modified both of your MFC console samples to see if I could get either one to work with keyboard-interactive authentication, but I could not. I am sending along my modified version of your console sample with fast notifications for you to try. In that sample if I change the call to SetAuthentication() to use password authentication instead of keyboard interactive authentication it works fine, so I know my login and password are ok. With SetAuthentication() set to keyboard interactive though, when the Connected event fires it is passed in an error code of 30016 (Invalid username or password reported by server...). Do you know of any reasons the LoginChallenge event might not get fired. I am testing against 2 different SSH servers I set up (OpenSSH and WinSSHD) and can login using keyboard interactive authentication through a Putty client.

Thanks,

Jeff

Re: keyboard-interactive authentication

by wodSupport, Wednesday, December 28, 2005, 23:35 (6904 days ago) @ Jeff

Jeff,

well, I cannot be sure. Only thing that comes to my mind is that server does not support keyboard-interactive authentication. Could this be possible? How can you be 100 sure Putty uses it?

I have tried our samples, and your attached project against our local OpenSSH and it did work ok, I did see event fired.

Perhaps you have some older version of wodSSH which perhaps have some bug?

Re: keyboard-interactive authentication

by Jeff, Thursday, December 29, 2005, 22:54 (6903 days ago) @ wodSupport

You are right - my server was not set up to use keyboard-interactive authentication. I had assumed it was because when I logged in through Putty it was asking me for a login then a password. I took that to mean keyboard-interactive. Upon testing against your server I did see the event fired correctly.

Thanks for you help!