Authorization failures return 403 with cookie populated. This forces the user to... 99/299/2
authorMadhu Venugopal <vmadhu@cisco.com>
Mon, 6 May 2013 18:15:51 +0000 (11:15 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 6 May 2013 19:37:29 +0000 (19:37 +0000)
before reauthenticating. Added a custom 403 page with session invalidated.

Change-Id: I68d724a9ac9c6920f9d3eda5a54bba7d731542fc
Signed-off-by: Madhu Venugopal <vmadhu@cisco.com>
opendaylight/web/devices/src/main/resources/WEB-INF/jsp/autherror.jsp [new file with mode: 0644]
opendaylight/web/devices/src/main/resources/WEB-INF/web.xml
opendaylight/web/flows/src/main/resources/WEB-INF/jsp/autherror.jsp [new file with mode: 0644]
opendaylight/web/flows/src/main/resources/WEB-INF/web.xml
opendaylight/web/root/src/main/resources/WEB-INF/jsp/autherror.jsp [new file with mode: 0644]
opendaylight/web/root/src/main/resources/WEB-INF/web.xml
opendaylight/web/topology/src/main/resources/WEB-INF/jsp/autherror.jsp [new file with mode: 0644]
opendaylight/web/topology/src/main/resources/WEB-INF/web.xml
opendaylight/web/troubleshoot/src/main/resources/WEB-INF/jsp/autherror.jsp [new file with mode: 0644]
opendaylight/web/troubleshoot/src/main/resources/WEB-INF/web.xml

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 (file)
index 0000000..ef42d28
--- /dev/null
@@ -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" %>
+
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+
+    <!-- Bootstrap CSS - 1 -->
+    <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
+    
+    <!-- Login CSS - 2 -->
+    <link rel="stylesheet/less" type="text/css" href="/css/login.less">
+
+<c:set var="title" value="OpenDaylight login error" scope="application"/>
+<%
+       if (session != null) session.invalidate();
+    String filePath = "/WEB-INF/jsp/customerror.jsp"; 
+       URL fileURL = pageContext.getServletContext().getResource(filePath);
+       if(fileURL!=null) {
+%>
+         <jsp:include page="<%=filePath%>" flush="true"/>
+<% } %>
+       <title>${title}</title>
+    <!-- Bootstrap JS - 1 -->
+    <script src="/js/bootstrap.min.js"></script>
+    
+    <!-- LESS - 2 -->
+    <script type="text/javascript">
+        less = {
+            env: "production"
+        };
+    </script>
+    <script src="/js/less-1.3.3.min.js"></script>
+</head>
+<body>
+        <form action="<c:url value='/' />" id="form" method="post">
+
+  <div class="container">
+    <div class="content">
+       <div class="login-form">
+         <div id="logo"></div>
+           <fieldset>
+            <p>You are not authorized to access this resource.<p>
+            <p>Please contact your administrator to resolve your Role privileges.</p>
+            <br/>
+             <button class="btn btn-primary" type="submit" value="Log In" >Go To Login Page</button>
+           </fieldset>
+       </div>
+    </div>
+  </div> 
+  </form>
+</body>
+</html>
index 0ebb738..0c7edce 100644 (file)
                </form-login-config>
        </login-config>
 
+    <error-page>
+            <error-code>403</error-code>
+            <location>/WEB-INF/jsp/autherror.jsp</location>
+    </error-page>
+
        <servlet>
                <servlet-name>Devices</servlet-name>
                <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
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 (file)
index 0000000..ef42d28
--- /dev/null
@@ -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" %>
+
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+
+    <!-- Bootstrap CSS - 1 -->
+    <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
+    
+    <!-- Login CSS - 2 -->
+    <link rel="stylesheet/less" type="text/css" href="/css/login.less">
+
+<c:set var="title" value="OpenDaylight login error" scope="application"/>
+<%
+       if (session != null) session.invalidate();
+    String filePath = "/WEB-INF/jsp/customerror.jsp"; 
+       URL fileURL = pageContext.getServletContext().getResource(filePath);
+       if(fileURL!=null) {
+%>
+         <jsp:include page="<%=filePath%>" flush="true"/>
+<% } %>
+       <title>${title}</title>
+    <!-- Bootstrap JS - 1 -->
+    <script src="/js/bootstrap.min.js"></script>
+    
+    <!-- LESS - 2 -->
+    <script type="text/javascript">
+        less = {
+            env: "production"
+        };
+    </script>
+    <script src="/js/less-1.3.3.min.js"></script>
+</head>
+<body>
+        <form action="<c:url value='/' />" id="form" method="post">
+
+  <div class="container">
+    <div class="content">
+       <div class="login-form">
+         <div id="logo"></div>
+           <fieldset>
+            <p>You are not authorized to access this resource.<p>
+            <p>Please contact your administrator to resolve your Role privileges.</p>
+            <br/>
+             <button class="btn btn-primary" type="submit" value="Log In" >Go To Login Page</button>
+           </fieldset>
+       </div>
+    </div>
+  </div> 
+  </form>
+</body>
+</html>
index adbdf75..5660a37 100644 (file)
                </form-login-config>
        </login-config>
 
+    <error-page>
+            <error-code>403</error-code>
+            <location>/WEB-INF/jsp/autherror.jsp</location>
+    </error-page>
 
        <listener>
                <listener-class>org.opendaylight.controller.web.ControllerUISessionManager</listener-class>
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 (file)
index 0000000..ef42d28
--- /dev/null
@@ -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" %>
+
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+
+    <!-- Bootstrap CSS - 1 -->
+    <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
+    
+    <!-- Login CSS - 2 -->
+    <link rel="stylesheet/less" type="text/css" href="/css/login.less">
+
+<c:set var="title" value="OpenDaylight login error" scope="application"/>
+<%
+       if (session != null) session.invalidate();
+    String filePath = "/WEB-INF/jsp/customerror.jsp"; 
+       URL fileURL = pageContext.getServletContext().getResource(filePath);
+       if(fileURL!=null) {
+%>
+         <jsp:include page="<%=filePath%>" flush="true"/>
+<% } %>
+       <title>${title}</title>
+    <!-- Bootstrap JS - 1 -->
+    <script src="/js/bootstrap.min.js"></script>
+    
+    <!-- LESS - 2 -->
+    <script type="text/javascript">
+        less = {
+            env: "production"
+        };
+    </script>
+    <script src="/js/less-1.3.3.min.js"></script>
+</head>
+<body>
+        <form action="<c:url value='/' />" id="form" method="post">
+
+  <div class="container">
+    <div class="content">
+       <div class="login-form">
+         <div id="logo"></div>
+           <fieldset>
+            <p>You are not authorized to access this resource.<p>
+            <p>Please contact your administrator to resolve your Role privileges.</p>
+            <br/>
+             <button class="btn btn-primary" type="submit" value="Log In" >Go To Login Page</button>
+           </fieldset>
+       </div>
+    </div>
+  </div> 
+  </form>
+</body>
+</html>
index a14d1c5..d96fb6e 100644 (file)
                </form-login-config>
        </login-config>
 
+    <error-page>
+            <error-code>403</error-code>
+            <location>/WEB-INF/jsp/autherror.jsp</location>
+    </error-page>
+
        <servlet>
                <servlet-name>RootGUI</servlet-name>
                <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
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 (file)
index 0000000..ef42d28
--- /dev/null
@@ -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" %>
+
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+
+    <!-- Bootstrap CSS - 1 -->
+    <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
+    
+    <!-- Login CSS - 2 -->
+    <link rel="stylesheet/less" type="text/css" href="/css/login.less">
+
+<c:set var="title" value="OpenDaylight login error" scope="application"/>
+<%
+       if (session != null) session.invalidate();
+    String filePath = "/WEB-INF/jsp/customerror.jsp"; 
+       URL fileURL = pageContext.getServletContext().getResource(filePath);
+       if(fileURL!=null) {
+%>
+         <jsp:include page="<%=filePath%>" flush="true"/>
+<% } %>
+       <title>${title}</title>
+    <!-- Bootstrap JS - 1 -->
+    <script src="/js/bootstrap.min.js"></script>
+    
+    <!-- LESS - 2 -->
+    <script type="text/javascript">
+        less = {
+            env: "production"
+        };
+    </script>
+    <script src="/js/less-1.3.3.min.js"></script>
+</head>
+<body>
+        <form action="<c:url value='/' />" id="form" method="post">
+
+  <div class="container">
+    <div class="content">
+       <div class="login-form">
+         <div id="logo"></div>
+           <fieldset>
+            <p>You are not authorized to access this resource.<p>
+            <p>Please contact your administrator to resolve your Role privileges.</p>
+            <br/>
+             <button class="btn btn-primary" type="submit" value="Log In" >Go To Login Page</button>
+           </fieldset>
+       </div>
+    </div>
+  </div> 
+  </form>
+</body>
+</html>
index 0d14373..274908c 100644 (file)
                </form-login-config>
        </login-config>
 
+    <error-page>
+            <error-code>403</error-code>
+            <location>/WEB-INF/jsp/autherror.jsp</location>
+    </error-page>
+
        <servlet>
                <servlet-name>Topology</servlet-name>
                <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
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 (file)
index 0000000..ef42d28
--- /dev/null
@@ -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" %>
+
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+
+    <!-- Bootstrap CSS - 1 -->
+    <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
+    
+    <!-- Login CSS - 2 -->
+    <link rel="stylesheet/less" type="text/css" href="/css/login.less">
+
+<c:set var="title" value="OpenDaylight login error" scope="application"/>
+<%
+       if (session != null) session.invalidate();
+    String filePath = "/WEB-INF/jsp/customerror.jsp"; 
+       URL fileURL = pageContext.getServletContext().getResource(filePath);
+       if(fileURL!=null) {
+%>
+         <jsp:include page="<%=filePath%>" flush="true"/>
+<% } %>
+       <title>${title}</title>
+    <!-- Bootstrap JS - 1 -->
+    <script src="/js/bootstrap.min.js"></script>
+    
+    <!-- LESS - 2 -->
+    <script type="text/javascript">
+        less = {
+            env: "production"
+        };
+    </script>
+    <script src="/js/less-1.3.3.min.js"></script>
+</head>
+<body>
+        <form action="<c:url value='/' />" id="form" method="post">
+
+  <div class="container">
+    <div class="content">
+       <div class="login-form">
+         <div id="logo"></div>
+           <fieldset>
+            <p>You are not authorized to access this resource.<p>
+            <p>Please contact your administrator to resolve your Role privileges.</p>
+            <br/>
+             <button class="btn btn-primary" type="submit" value="Log In" >Go To Login Page</button>
+           </fieldset>
+       </div>
+    </div>
+  </div> 
+  </form>
+</body>
+</html>
index b83df23..47d38f9 100644 (file)
                </form-login-config>
        </login-config>
 
-
+    <error-page>
+            <error-code>403</error-code>
+            <location>/WEB-INF/jsp/autherror.jsp</location>
+    </error-page>
 
        <listener>
                <listener-class>org.opendaylight.controller.web.ControllerUISessionManager</listener-class>