From e270e212f3849b12e1a1d2e9f03a8243b1e9ecc7 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 6 Jul 2015 14:31:28 +0200 Subject: [client] reworked exceptions handling of BWIDM auth --- dozentenmodul/src/main/java/util/ShibbolethECP.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'dozentenmodul/src/main/java/util/ShibbolethECP.java') 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); -- cgit v1.2.3-55-g7522