From 0cb7e3604b8a33f6b1aa01c561137e6c6aad85b0 Mon Sep 17 00:00:00 2001 From: Madhu Venugopal Date: Mon, 6 May 2013 11:15:51 -0700 Subject: [PATCH] Authorization failures return 403 with cookie populated. This forces the user to clear the cache before reauthenticating. Added a custom 403 page with session invalidated. Change-Id: I68d724a9ac9c6920f9d3eda5a54bba7d731542fc Signed-off-by: Madhu Venugopal --- .../main/resources/WEB-INF/jsp/autherror.jsp | 55 +++++++++++++++++++ .../src/main/resources/WEB-INF/web.xml | 5 ++ .../main/resources/WEB-INF/jsp/autherror.jsp | 55 +++++++++++++++++++ .../flows/src/main/resources/WEB-INF/web.xml | 4 ++ .../main/resources/WEB-INF/jsp/autherror.jsp | 55 +++++++++++++++++++ .../root/src/main/resources/WEB-INF/web.xml | 5 ++ .../main/resources/WEB-INF/jsp/autherror.jsp | 55 +++++++++++++++++++ .../src/main/resources/WEB-INF/web.xml | 5 ++ .../main/resources/WEB-INF/jsp/autherror.jsp | 55 +++++++++++++++++++ .../src/main/resources/WEB-INF/web.xml | 5 +- 10 files changed, 298 insertions(+), 1 deletion(-) create mode 100644 opendaylight/web/devices/src/main/resources/WEB-INF/jsp/autherror.jsp create mode 100644 opendaylight/web/flows/src/main/resources/WEB-INF/jsp/autherror.jsp create mode 100644 opendaylight/web/root/src/main/resources/WEB-INF/jsp/autherror.jsp create mode 100644 opendaylight/web/topology/src/main/resources/WEB-INF/jsp/autherror.jsp create mode 100644 opendaylight/web/troubleshoot/src/main/resources/WEB-INF/jsp/autherror.jsp diff --git a/opendaylight/web/devices/src/main/resources/WEB-INF/jsp/autherror.jsp b/opendaylight/web/devices/src/main/resources/WEB-INF/jsp/autherror.jsp new file mode 100644 index 0000000000..ef42d286eb --- /dev/null +++ b/opendaylight/web/devices/src/main/resources/WEB-INF/jsp/autherror.jsp @@ -0,0 +1,55 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page import="java.net.URL" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + + + + + + + + + + + + + +<% + if (session != null) session.invalidate(); + String filePath = "/WEB-INF/jsp/customerror.jsp"; + URL fileURL = pageContext.getServletContext().getResource(filePath); + if(fileURL!=null) { +%> + +<% } %> + ${title} + + + + + + + + +
+ +
+
+ +
+
+
+ + diff --git a/opendaylight/web/devices/src/main/resources/WEB-INF/web.xml b/opendaylight/web/devices/src/main/resources/WEB-INF/web.xml index 0ebb738473..0c7edce249 100644 --- a/opendaylight/web/devices/src/main/resources/WEB-INF/web.xml +++ b/opendaylight/web/devices/src/main/resources/WEB-INF/web.xml @@ -47,6 +47,11 @@ + + 403 + /WEB-INF/jsp/autherror.jsp + + Devices org.springframework.web.servlet.DispatcherServlet diff --git a/opendaylight/web/flows/src/main/resources/WEB-INF/jsp/autherror.jsp b/opendaylight/web/flows/src/main/resources/WEB-INF/jsp/autherror.jsp new file mode 100644 index 0000000000..ef42d286eb --- /dev/null +++ b/opendaylight/web/flows/src/main/resources/WEB-INF/jsp/autherror.jsp @@ -0,0 +1,55 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page import="java.net.URL" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + + + + + + + + + + + + + +<% + if (session != null) session.invalidate(); + String filePath = "/WEB-INF/jsp/customerror.jsp"; + URL fileURL = pageContext.getServletContext().getResource(filePath); + if(fileURL!=null) { +%> + +<% } %> + ${title} + + + + + + + + +
+ +
+
+ +
+
+
+ + diff --git a/opendaylight/web/flows/src/main/resources/WEB-INF/web.xml b/opendaylight/web/flows/src/main/resources/WEB-INF/web.xml index adbdf75b7c..5660a37a14 100644 --- a/opendaylight/web/flows/src/main/resources/WEB-INF/web.xml +++ b/opendaylight/web/flows/src/main/resources/WEB-INF/web.xml @@ -60,6 +60,10 @@ + + 403 + /WEB-INF/jsp/autherror.jsp + org.opendaylight.controller.web.ControllerUISessionManager diff --git a/opendaylight/web/root/src/main/resources/WEB-INF/jsp/autherror.jsp b/opendaylight/web/root/src/main/resources/WEB-INF/jsp/autherror.jsp new file mode 100644 index 0000000000..ef42d286eb --- /dev/null +++ b/opendaylight/web/root/src/main/resources/WEB-INF/jsp/autherror.jsp @@ -0,0 +1,55 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page import="java.net.URL" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + + + + + + + + + + + + + +<% + if (session != null) session.invalidate(); + String filePath = "/WEB-INF/jsp/customerror.jsp"; + URL fileURL = pageContext.getServletContext().getResource(filePath); + if(fileURL!=null) { +%> + +<% } %> + ${title} + + + + + + + + +
+ +
+
+ +
+
+
+ + diff --git a/opendaylight/web/root/src/main/resources/WEB-INF/web.xml b/opendaylight/web/root/src/main/resources/WEB-INF/web.xml index a14d1c505b..d96fb6eba2 100644 --- a/opendaylight/web/root/src/main/resources/WEB-INF/web.xml +++ b/opendaylight/web/root/src/main/resources/WEB-INF/web.xml @@ -52,6 +52,11 @@ + + 403 + /WEB-INF/jsp/autherror.jsp + + RootGUI org.springframework.web.servlet.DispatcherServlet diff --git a/opendaylight/web/topology/src/main/resources/WEB-INF/jsp/autherror.jsp b/opendaylight/web/topology/src/main/resources/WEB-INF/jsp/autherror.jsp new file mode 100644 index 0000000000..ef42d286eb --- /dev/null +++ b/opendaylight/web/topology/src/main/resources/WEB-INF/jsp/autherror.jsp @@ -0,0 +1,55 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page import="java.net.URL" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + + + + + + + + + + + + + +<% + if (session != null) session.invalidate(); + String filePath = "/WEB-INF/jsp/customerror.jsp"; + URL fileURL = pageContext.getServletContext().getResource(filePath); + if(fileURL!=null) { +%> + +<% } %> + ${title} + + + + + + + + +
+ +
+
+ +
+
+
+ + diff --git a/opendaylight/web/topology/src/main/resources/WEB-INF/web.xml b/opendaylight/web/topology/src/main/resources/WEB-INF/web.xml index 0d143739c3..274908caec 100644 --- a/opendaylight/web/topology/src/main/resources/WEB-INF/web.xml +++ b/opendaylight/web/topology/src/main/resources/WEB-INF/web.xml @@ -46,6 +46,11 @@ + + 403 + /WEB-INF/jsp/autherror.jsp + + Topology org.springframework.web.servlet.DispatcherServlet diff --git a/opendaylight/web/troubleshoot/src/main/resources/WEB-INF/jsp/autherror.jsp b/opendaylight/web/troubleshoot/src/main/resources/WEB-INF/jsp/autherror.jsp new file mode 100644 index 0000000000..ef42d286eb --- /dev/null +++ b/opendaylight/web/troubleshoot/src/main/resources/WEB-INF/jsp/autherror.jsp @@ -0,0 +1,55 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page import="java.net.URL" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + + + + + + + + + + + + + +<% + if (session != null) session.invalidate(); + String filePath = "/WEB-INF/jsp/customerror.jsp"; + URL fileURL = pageContext.getServletContext().getResource(filePath); + if(fileURL!=null) { +%> + +<% } %> + ${title} + + + + + + + + +
+ +
+
+ +
+
+
+ + diff --git a/opendaylight/web/troubleshoot/src/main/resources/WEB-INF/web.xml b/opendaylight/web/troubleshoot/src/main/resources/WEB-INF/web.xml index b83df23cb0..47d38f9a53 100644 --- a/opendaylight/web/troubleshoot/src/main/resources/WEB-INF/web.xml +++ b/opendaylight/web/troubleshoot/src/main/resources/WEB-INF/web.xml @@ -62,7 +62,10 @@ - + + 403 + /WEB-INF/jsp/autherror.jsp + org.opendaylight.controller.web.ControllerUISessionManager -- 2.36.6