summaryrefslogtreecommitdiffstats
path: root/src/madc.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-08-27 18:39:44 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-08-27 18:39:44 +0200
commit96b69222fa0c22d0eaefaae291e78913b2ae13e9 (patch)
tree335a7f4706db8c4fa71eea0f250215565dd17aea /src/madc.cpp
parent82ef58fb3d0bdf6ce7d13f42cca30d03b24973c6 (diff)
downloadmad-96b69222fa0c22d0eaefaae291e78913b2ae13e9.tar
mad-96b69222fa0c22d0eaefaae291e78913b2ae13e9.zip
AuthBackendChallengeResponse hinzugefügt
Diffstat (limited to 'src/madc.cpp')
-rw-r--r--src/madc.cpp11
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;