diff options
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java index 2f40f782..6a226e1e 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java @@ -6,10 +6,10 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URL; -import org.apache.http.HttpResponse; -import org.apache.http.ParseException; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.util.EntityUtils; +import org.apache.hc.client5.http.ClientProtocolException; +import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse; +import org.apache.hc.core5.http.ParseException; +import org.apache.hc.core5.http.io.entity.EntityUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.AuthorizationError; @@ -135,7 +135,7 @@ public class ShibbolethEcp { final ECPAuthenticator auth = new ECPAuthenticator(ProxyConfigurator.getClient(), user, pass, new URI(idpUrl), BWLP_SP); auth.setRetryWithoutAt(true); - HttpResponse spResponse; + CloseableHttpResponse spResponse; try { spResponse = auth.authenticate(); } catch (ECPAuthenticationException e) { @@ -143,10 +143,10 @@ public class ShibbolethEcp { throw new TAuthorizationException(AuthorizationError.GENERIC_ERROR, e.getMessage()); } - if (spResponse.getStatusLine().getStatusCode() != 200) { + if (spResponse.getCode() != 200) { LOGGER.error("SP does not return HTTP status code 200"); throw new TAuthorizationException(AuthorizationError.GENERIC_ERROR, "SP says: " - + spResponse.getStatusLine().toString()); + + spResponse.getReasonPhrase()); } LOGGER.debug("Login complete, getting body"); |