diff options
| author | Jonathan Bauer | 2015-07-06 14:31:28 +0200 |
|---|---|---|
| committer | Jonathan Bauer | 2015-07-06 14:31:28 +0200 |
| commit | e270e212f3849b12e1a1d2e9f03a8243b1e9ecc7 (patch) | |
| tree | ae34be79ebfea206718a71e0f72712776c9bcb6c /dozentenmodul/src/main/java/gui | |
| parent | [client] Add classes for caching of data fetched via thrift (diff) | |
| download | tutor-module-e270e212f3849b12e1a1d2e9f03a8243b1e9ecc7.tar.gz tutor-module-e270e212f3849b12e1a1d2e9f03a8243b1e9ecc7.tar.xz tutor-module-e270e212f3849b12e1a1d2e9f03a8243b1e9ecc7.zip | |
[client] reworked exceptions handling of BWIDM auth
Diffstat (limited to 'dozentenmodul/src/main/java/gui')
| -rw-r--r-- | dozentenmodul/src/main/java/gui/core/LoginGUI.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/dozentenmodul/src/main/java/gui/core/LoginGUI.java b/dozentenmodul/src/main/java/gui/core/LoginGUI.java index 5c329d5d..6ca06518 100644 --- a/dozentenmodul/src/main/java/gui/core/LoginGUI.java +++ b/dozentenmodul/src/main/java/gui/core/LoginGUI.java @@ -10,6 +10,7 @@ import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.widgets.Shell; import org.openslx.bwlp.thrift.iface.Organization; +import org.openslx.bwlp.thrift.iface.TAuthenticationException; import org.openslx.bwlp.thrift.iface.UserInfo; import org.openslx.thrifthelper.ThriftManager; @@ -24,6 +25,7 @@ public class LoginGUI extends LoginComposite { private final String NO_USERNAME = "Kein Benutzername angegeben!"; private final String NO_PASSWORD = "Kein Passwort angegeben!"; + private final String BAD_AUTH = "Authentifizierung fehlgeschlagen!"; private String username = null; private String password = null; @@ -148,14 +150,20 @@ public class LoginGUI extends LoginComposite { case BWIDM: BWIDMAuthenticator bwidmAuth = new BWIDMAuthenticator( selectedOrg.getEcpUrl()); - bwidmAuth.login(username, password, new AuthenticatorCallback() { - @Override - public void postLogin(UserInfo user) { - LOGGER.info(user.firstName + " " + user.lastName); - if (user != null) - GuiManager.addContent(new DisclaimerComposite(getShell())); - } - }); + try { + bwidmAuth.login(username, password, new AuthenticatorCallback() { + @Override + public void postLogin(UserInfo user) { + LOGGER.info(user.firstName + " " + user.lastName); + if (user != null) + GuiManager.addContent(new DisclaimerComposite(getShell())); + } + }); + } catch (TAuthenticationException e) { + LOGGER.error("Authentication error, see trace: ", e); + GuiManager.showMessage(BAD_AUTH); + return; + } break; case BWLP: LOGGER.info("bwlp"); |
