Changing NB API authentication/authorization to use Tomcat Valve.
[controller.git] / opendaylight / northbound / subnets / src / main / resources / WEB-INF / web.xml
index b0fc9ee97a3563249205e296b5894542aa234b1a..1c201d3b33eb590ce57d70ac180c0abee48b6fba 100644 (file)
@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
-http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
-  version="2.4">
+<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+       version="3.0">  
   <servlet>
     <servlet-name>JAXRSSubnets</servlet-name>
-    <servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
+    <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <init-param>
       <param-name>javax.ws.rs.Application</param-name>
       <param-value>org.opendaylight.controller.subnets.northbound.SubnetsNorthboundRSApplication</param-value>
@@ -17,26 +16,34 @@ http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
     <servlet-name>JAXRSSubnets</servlet-name>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
-<!-- Spring Security related -->
+       <security-constraint>
+               <web-resource-collection>
+                       <web-resource-name>NB api</web-resource-name>
+                       <url-pattern>/*</url-pattern>
+               </web-resource-collection>
+               <auth-constraint>
+                       <role-name>System-Admin</role-name>
+                       <role-name>Network-Admin</role-name>
+                       <role-name>Network-Operator</role-name>
+                       <role-name>Container-User</role-name>
+               </auth-constraint>
+       </security-constraint>
 
-       <listener>
-       <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
-       </listener>
+       <security-role>
+               <role-name>System-Admin</role-name>
+       </security-role>
+       <security-role>
+               <role-name>Network-Admin</role-name>
+       </security-role>
+       <security-role>
+               <role-name>Network-Operator</role-name>
+       </security-role>
+       <security-role>
+               <role-name>Container-User</role-name>
+       </security-role>
 
-       <context-param>
-               <param-name>contextConfigLocation</param-name>
-               <param-value>/WEB-INF/spring/*.xml</param-value>
-       </context-param>
-
-       <filter>
-           <filter-name>springSecurityFilterChain</filter-name>
-           <filter-class>
-               org.springframework.web.filter.DelegatingFilterProxy
-           </filter-class>
-       </filter>
-       
-       <filter-mapping>
-           <filter-name>springSecurityFilterChain</filter-name>
-           <url-pattern>/*</url-pattern>
-       </filter-mapping>
+       <login-config>
+               <auth-method>BASIC</auth-method>
+               <realm-name>opendaylight</realm-name>
+       </login-config>
 </web-app>