summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/aai/sparky/security/filter/LoginFilter.java
diff options
context:
space:
mode:
authorShawn Severin <shawn.severin@amdocs.com>2017-12-11 15:42:52 -0500
committerShawn Severin <shawn.severin@amdocs.com>2017-12-11 15:43:42 -0500
commit7b42006c51d4f014f72ae39170544a85d2f09fb5 (patch)
tree9dc8c0f56d7b85e843f7f29bae7c9207b118bd18 /src/main/java/org/onap/aai/sparky/security/filter/LoginFilter.java
parent1249ee87c69c9c4566f2c52c5cbb56e4089044c4 (diff)
Adding UI extensibility
Adding the ability for Sparky developers to create their own custom front-end views Issue-ID: AAI-542 Change-Id: I83f9608639799e3bf85b654f44a0a7a5a85ad264 Signed-off-by: Shawn Severin <shawn.severin@amdocs.com>
Diffstat (limited to 'src/main/java/org/onap/aai/sparky/security/filter/LoginFilter.java')
-rw-r--r--src/main/java/org/onap/aai/sparky/security/filter/LoginFilter.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/main/java/org/onap/aai/sparky/security/filter/LoginFilter.java b/src/main/java/org/onap/aai/sparky/security/filter/LoginFilter.java
index 445cfba..2ec6b47 100644
--- a/src/main/java/org/onap/aai/sparky/security/filter/LoginFilter.java
+++ b/src/main/java/org/onap/aai/sparky/security/filter/LoginFilter.java
@@ -36,11 +36,11 @@ import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.ws.rs.core.HttpHeaders;
+import org.onap.aai.cl.api.Logger;
+import org.onap.aai.cl.eelf.LoggerFactory;
import org.onap.aai.sparky.logging.AaiUiMsgs;
import org.onap.aai.sparky.security.EcompSso;
import org.onap.aai.sparky.security.portal.config.PortalAuthenticationConfig;
-import org.onap.aai.cl.api.Logger;
-import org.onap.aai.cl.eelf.LoggerFactory;
import org.openecomp.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
@@ -126,10 +126,17 @@ public class LoginFilter implements Filter {
// All other requests require ECOMP Portal authentication
if (EcompSso.validateEcompSso(request) == null) {
String redirectURL, logMessage;
-
- // Redirect to Portal UI
- redirectURL = PortalApiProperties.getProperty(PortalApiConstants.ECOMP_REDIRECT_URL);
- logMessage = "Unauthorized login attempt.";
+ if (request.getRequestURI().contains("/editAttributes")) {
+ // If request is for Edit Attributes UI, redirect straight to the application.
+ String appPath = request.getRequestURI().substring(request.getContextPath().length() + 1)
+ + (request.getQueryString() != null ? ("?" + request.getQueryString()) : "");
+ redirectURL = SSOUtil.getECOMPSSORedirectURL(request, response, appPath);
+ logMessage = "Unauthenticated Edit Attributes UI login attempt.";
+ } else {
+ // Redirect to Portal UI
+ redirectURL = PortalApiProperties.getProperty(PortalApiConstants.ECOMP_REDIRECT_URL);
+ logMessage = "Unauthorized login attempt.";
+ }
LOG.debug(AaiUiMsgs.LOGIN_FILTER_DEBUG,
logMessage + " | Remote IP: " + request.getRemoteAddr() + " | User agent: "