X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dashboard%2Fwebapp-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fportalapi%2FPortalAuthenticationFilter.java;h=5c1f75cb1def00a2d789f74b613ac032d3327282;hb=5408c157fc8aca52731fcc2cc035ed9dbfcff219;hp=711761a4b73750481d12d55db57891b58615f674;hpb=592ce20ec359928373de2e7f06214c8f8ad73c20;p=nonrtric.git diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/portalapi/PortalAuthenticationFilter.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/portalapi/PortalAuthenticationFilter.java index 711761a4..5c1f75cb 100644 --- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/portalapi/PortalAuthenticationFilter.java +++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/portalapi/PortalAuthenticationFilter.java @@ -3,6 +3,7 @@ * O-RAN-SC * %% * Copyright (C) 2019 AT&T Intellectual Property + * Modifications Copyright (C) 2020 Nordix Foundation * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,7 +73,7 @@ import org.springframework.security.web.authentication.preauth.PreAuthenticatedA * created and EPService cookie is set. * * - * TODO: What about sessions? Will this be stateless? + * Open question: What about sessions? Will this be stateless? * * This filter uses no annotations to avoid Spring's automatic registration, * which add this filter in the chain in the wrong order. @@ -94,7 +95,7 @@ public class PortalAuthenticationFilter implements Filter { private final DashboardUserManager userManager; public PortalAuthenticationFilter(boolean portalSecurity, PortalAuthManager authManager, - DashboardUserManager userManager) { + DashboardUserManager userManager) throws IOException { this.enforcePortalSecurity = portalSecurity; this.authManager = authManager; this.userManager = userManager; @@ -105,7 +106,7 @@ public class PortalAuthenticationFilter implements Filter { if (in == null) { String msg = "Failed to find property file on classpath: " + pf; logger.error(msg); - throw new RuntimeException(msg); + throw new IOException(msg); } else { try { in.close(); @@ -225,7 +226,7 @@ public class PortalAuthenticationFilter implements Filter { String redirectUrl = portalBaseUrl + "?" + PortalAuthenticationFilter.REDIRECT_URL_KEY + "=" + encodedAppUrl; String aHref = ""; // If only Java had "here" documents. - String body = String.join(// + return String.join(// System.getProperty("line.separator"), // "", // "", // @@ -244,7 +245,6 @@ public class PortalAuthenticationFilter implements Filter { "

", // "", // ""); - return body; } /**