diff options
| author | Jonathan Bauer | 2015-07-08 11:54:43 +0200 |
|---|---|---|
| committer | Jonathan Bauer | 2015-07-08 11:54:43 +0200 |
| commit | bc649c98ab604c4c605f1054d602389a728cccc3 (patch) | |
| tree | 1cad42598c493bfa8843fa6d9fd4e28b15ccd332 /dozentenmodul/src/main/java/auth | |
| parent | [client] authenticator for the direct masterserver login (diff) | |
| download | tutor-module-bc649c98ab604c4c605f1054d602389a728cccc3.tar.gz tutor-module-bc649c98ab604c4c605f1054d602389a728cccc3.tar.xz tutor-module-bc649c98ab604c4c605f1054d602389a728cccc3.zip | |
[client] user feedback when login fails.
Need to change TAuthorizationException received on failed login by a TAuthenticationException,
then we can actually do a proper handling of that error
Diffstat (limited to 'dozentenmodul/src/main/java/auth')
| -rw-r--r-- | dozentenmodul/src/main/java/auth/BWLPAuthenticator.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dozentenmodul/src/main/java/auth/BWLPAuthenticator.java b/dozentenmodul/src/main/java/auth/BWLPAuthenticator.java index f619b453..66c31d73 100644 --- a/dozentenmodul/src/main/java/auth/BWLPAuthenticator.java +++ b/dozentenmodul/src/main/java/auth/BWLPAuthenticator.java @@ -4,6 +4,7 @@ import org.apache.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.SessionData; import org.openslx.bwlp.thrift.iface.TAuthenticationException; +import org.openslx.bwlp.thrift.iface.TAuthorizationException; import org.openslx.bwlp.thrift.iface.UserInfo; import org.openslx.thrifthelper.ThriftManager; @@ -30,6 +31,8 @@ public class BWLPAuthenticator implements BaseAuthenticator { authResult = ThriftManager.getMasterClient().authenticate(username, password); } catch (TException e) { LOGGER.error("Thrift communication error: ", e); + // TODO authenticate has to return a TAuthenticationException! + callback.postLogin(ReturnCode.ERROR_OTHER, null); return; } @@ -40,6 +43,9 @@ public class BWLPAuthenticator implements BaseAuthenticator { userInfo = ThriftManager.getMasterClient().getUserFromToken(authResult.authToken); } catch (TException e) { LOGGER.error("Thrift communication error: ", e); + // TODO authenticate has to return a TAuthenticationException! + callback.postLogin(ReturnCode.ERROR_OTHER, null); + return; } callback.postLogin(ReturnCode.NO_ERROR, userInfo); } else { |
