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/util/ShibbolethECP.java | |
| 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/util/ShibbolethECP.java')
| -rw-r--r-- | dozentenmodul/src/main/java/util/ShibbolethECP.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/dozentenmodul/src/main/java/util/ShibbolethECP.java b/dozentenmodul/src/main/java/util/ShibbolethECP.java index f3e35400..67936906 100644 --- a/dozentenmodul/src/main/java/util/ShibbolethECP.java +++ b/dozentenmodul/src/main/java/util/ShibbolethECP.java @@ -12,6 +12,8 @@ import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpGet; import org.apache.http.util.EntityUtils; import org.apache.log4j.Logger; +import org.openslx.bwlp.thrift.iface.AuthenticationError; +import org.openslx.bwlp.thrift.iface.TAuthenticationException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -98,9 +100,9 @@ public class ShibbolethECP { * Password as String. * @return * true if login worked, false otherwise. - * @throws ECPAuthenticationException + * @throws TAuthenticationException */ - public static ReturnCode doLogin(final String idpUrl, final String user, final String pass) throws ECPAuthenticationException { + public static ReturnCode doLogin(final String idpUrl, final String user, final String pass) throws TAuthenticationException { // first lets do some sanity checks if (BWLP_SP == null) { @@ -132,7 +134,7 @@ public class ShibbolethECP { auth.authenticate(); } catch (ECPAuthenticationException e) { LOGGER.error("ECP Authentication Exception, see trace: ", e); - throw e; + throw new TAuthenticationException(AuthenticationError.GENERIC_ERROR, "ECP client failed to authenticate."); } // here test again for the SPURL HttpGet testSp = new HttpGet(BWLP_SP); |
