diff options
Diffstat (limited to 'src/madc.cpp')
-rw-r--r-- | src/madc.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/madc.cpp b/src/madc.cpp index 5f6039d..0f4639d 100644 --- a/src/madc.cpp +++ b/src/madc.cpp @@ -31,6 +31,7 @@ #include "Client/CommandParser.h" #include "Client/InformationManager.h" #include "Client/PasswordReader.h" +#include "Client/Authenticators/ChallengeResponseAuthenticator.h" #include "Client/Authenticators/PasswordAuthenticator.h" #include <iostream> @@ -80,7 +81,15 @@ int main(int argc, char *argv[]) { std::getline(std::cin, username); password = Client::PasswordReader::readPassword("Password: "); - Client::Authenticators::PasswordAuthenticator::authenticate(&application, connection, username, password); + try { + Client::Authenticators::ChallengeResponseAuthenticator::authenticate(&application, connection, username, password); + } + catch(Core::Exception e) { + if(e.getErrorCode() != Core::Exception::NOT_AVAILABLE) + throw e; + + Client::Authenticators::PasswordAuthenticator::authenticate(&application, connection, username, password); + } } std::cerr << "Login successful." << std::endl << std::endl; |