From 44240b20f863fbd437e06947b539f76e73e91668 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Mon, 2 Oct 2023 13:07:50 +0200 Subject: chore(core): code clean-up and optimization --- .../idp/auth/services/ProtocolAuthenticationService.java | 2 +- .../core/impl/idp/controller/protocols/RequestImpl.java | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) (limited to 'eaaf_core/src/main') diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java index 8dd208a9..0e454c7a 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java @@ -494,7 +494,7 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer try { final IGuiBuilderConfiguration config = guiConfigFactory - .getDefaultErrorGui(HttpUtils.extractAuthUrlFromRequest(httpReq)); + .getDefaultErrorGui(HttpUtils.extractAuthUrlStringFromRequest(httpReq)); String[] errorCodeParams = null; diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/protocols/RequestImpl.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/protocols/RequestImpl.java index 3b3e7cd8..f5703cab 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/protocols/RequestImpl.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/protocols/RequestImpl.java @@ -21,7 +21,6 @@ package at.gv.egiz.eaaf.core.impl.idp.controller.protocols; import java.io.Serializable; import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; import java.net.URL; import java.time.Instant; import java.util.HashMap; @@ -182,21 +181,13 @@ public abstract class RequestImpl implements IRequest, Serializable { // Random.nextLongRandom()); // check if End-Point is valid - final String authUrlString = HttpUtils.extractAuthUrlFromRequest(req); - URL authReqUrl; - try { - authReqUrl = new URL(authUrlString); - - } catch (final MalformedURLException e) { - log.error("IDP AuthenticationServiceURL Prefix is not a valid URL." + authUrlString, e); - throw new EaafAuthenticationException(ERROR_CODE_INTERNAL_00, new Object[] { authUrlString }, e); + URL authReqUrl = HttpUtils.extractAuthUrlFromRequest(req); - } this.idpAuthUrl = authConfig.validateIdpUrl(authReqUrl); if (this.idpAuthUrl == null) { log.warn( "Extract AuthenticationServiceURL: " + authReqUrl + " is NOT found in configuration."); - throw new EaafAuthenticationException(ERROR_CODE_INTERNAL_00, new Object[] { authUrlString }); + throw new EaafAuthenticationException(ERROR_CODE_INTERNAL_00, new Object[] { authReqUrl }); } -- cgit v1.2.3