Changing NB API authentication/authorization to use Tomcat Valve. 36/136/2
authorVenkatraghavan Sankarasubbu <vensanka@cisco.com>
Fri, 12 Apr 2013 22:54:17 +0000 (15:54 -0700)
committerVenkatraghavan Sankarasubbu <vensanka@cisco.com>
Fri, 12 Apr 2013 22:54:17 +0000 (15:54 -0700)
Affected modules
1. Flow Programmer
2. Host Tracker
3. Static Roting
4. Statistics
5. Subnets
6. Switch Manager
7. Topology
8. Loadbalancer
Change-Id: I94267ed1878c49b9615e956aa816473361ded8f2
Signed-off-by: Venkatraghavan Sankarasubbu <vensanka@cisco.com>
36 files changed:
opendaylight/commons/opendaylight/pom.xml
opendaylight/northbound/commons/pom.xml
opendaylight/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/AuthenticationProviderWrapper.java [deleted file]
opendaylight/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/WebSecurityContextRepository.java [deleted file]
opendaylight/northbound/flowprogrammer/pom.xml
opendaylight/northbound/flowprogrammer/src/main/resources/WEB-INF/spring/context.xml [deleted file]
opendaylight/northbound/flowprogrammer/src/main/resources/WEB-INF/spring/servlet/security.xml [deleted file]
opendaylight/northbound/flowprogrammer/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/hosttracker/pom.xml
opendaylight/northbound/hosttracker/src/main/resources/WEB-INF/spring/context.xml [deleted file]
opendaylight/northbound/hosttracker/src/main/resources/WEB-INF/spring/servlet/security.xml [deleted file]
opendaylight/northbound/hosttracker/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/staticrouting/pom.xml
opendaylight/northbound/staticrouting/src/main/resources/WEB-INF/spring/context.xml [deleted file]
opendaylight/northbound/staticrouting/src/main/resources/WEB-INF/spring/servlet/security.xml [deleted file]
opendaylight/northbound/staticrouting/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/statistics/pom.xml
opendaylight/northbound/statistics/src/main/resources/WEB-INF/spring/context.xml [deleted file]
opendaylight/northbound/statistics/src/main/resources/WEB-INF/spring/servlet/security.xml [deleted file]
opendaylight/northbound/statistics/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/subnets/pom.xml
opendaylight/northbound/subnets/src/main/resources/WEB-INF/spring/context.xml [deleted file]
opendaylight/northbound/subnets/src/main/resources/WEB-INF/spring/servlet/security.xml [deleted file]
opendaylight/northbound/subnets/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/switchmanager/pom.xml
opendaylight/northbound/switchmanager/src/main/resources/WEB-INF/spring/context.xml [deleted file]
opendaylight/northbound/switchmanager/src/main/resources/WEB-INF/spring/servlet/security.xml [deleted file]
opendaylight/northbound/switchmanager/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/topology/pom.xml
opendaylight/northbound/topology/src/main/resources/WEB-INF/spring/context.xml [deleted file]
opendaylight/northbound/topology/src/main/resources/WEB-INF/spring/servlet/security.xml [deleted file]
opendaylight/northbound/topology/src/main/resources/WEB-INF/web.xml
opendaylight/samples/northbound/loadbalancer/pom.xml
opendaylight/samples/northbound/loadbalancer/src/main/resources/WEB-INF/spring/context.xml [deleted file]
opendaylight/samples/northbound/loadbalancer/src/main/resources/WEB-INF/spring/servlet/security.xml [deleted file]
opendaylight/samples/northbound/loadbalancer/src/main/resources/WEB-INF/web.xml

index 370526aca126526a4919a5ce08dbef298951b038..f2817ed4812bcafd3a3bfd7995706ecbce50f12d 100644 (file)
       <artifactId>jersey-json</artifactId>
       <version>${jersey.version}</version>
     </dependency>
       <artifactId>jersey-json</artifactId>
       <version>${jersey.version}</version>
     </dependency>
-    <dependency>
-      <groupId>com.sun.jersey.contribs</groupId>
-      <artifactId>jersey-spring</artifactId>
-      <version>${jersey.version}</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.springframework</groupId>
-          <artifactId>spring</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.springframework</groupId>
-          <artifactId>spring-aop</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.springframework</groupId>
-          <artifactId>spring-core</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.springframework</groupId>
-          <artifactId>spring-web</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.springframework</groupId>
-          <artifactId>spring-beans</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.springframework</groupId>
-          <artifactId>spring-context</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
   </dependencies>
 </project>
   </dependencies>
 </project>
index 61e5304e7360c942722ce4a16daece224f0c1f10..d52bedf819b4556329c9c322fb3eb612c3197444 100644 (file)
               org.opendaylight.controller.sal.utils,
               org.opendaylight.controller.usermanager,
               javax.servlet.http, 
               org.opendaylight.controller.sal.utils,
               org.opendaylight.controller.usermanager,
               javax.servlet.http, 
-              org.slf4j, 
-              org.springframework.security.authentication, 
-              org.springframework.security.core, 
-              org.springframework.security.core.context, 
-              org.springframework.security.web.context               
+              org.slf4j,                              
             </Import-Package>
           </instructions>
         </configuration>
             </Import-Package>
           </instructions>
         </configuration>
       <artifactId>usermanager</artifactId>
       <version>0.4.0-SNAPSHOT</version>
     </dependency>
       <artifactId>usermanager</artifactId>
       <version>0.4.0-SNAPSHOT</version>
     </dependency>
-       <dependency>
-               <groupId>org.springframework.security</groupId>
-               <artifactId>spring-security-core</artifactId>
-               <version>${spring-security.version}</version>
-               <scope>provided</scope>
-       </dependency>
-       <dependency>
-               <groupId>org.springframework.security</groupId>
-               <artifactId>spring-security-web</artifactId>
-               <version>${spring-security.version}</version>
-               <scope>provided</scope>
-       </dependency>        
   </dependencies>
 </project>
   </dependencies>
 </project>
diff --git a/opendaylight/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/AuthenticationProviderWrapper.java b/opendaylight/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/AuthenticationProviderWrapper.java
deleted file mode 100644 (file)
index 821fb12..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.northbound.commons;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.security.authentication.AuthenticationProvider;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.AuthenticationException;
-
-import org.opendaylight.controller.sal.utils.ServiceHelper;
-import org.opendaylight.controller.usermanager.IUserManager;
-
-import org.opendaylight.controller.northbound.commons.exception.InternalServerErrorException;
-
-public class AuthenticationProviderWrapper implements AuthenticationProvider {
-
-    private static final Logger logger = LoggerFactory
-            .getLogger(AuthenticationProviderWrapper.class);
-
-    @Override
-    public Authentication authenticate(Authentication authentication)
-            throws AuthenticationException {
-        return ((AuthenticationProvider) getUserManagerRef())
-                .authenticate(authentication);
-    }
-
-    @Override
-    public boolean supports(Class<?> authentication) {
-        return ((AuthenticationProvider) getUserManagerRef())
-                .supports(authentication);
-    }
-
-    private IUserManager getUserManagerRef() {
-        IUserManager userManager = (IUserManager) ServiceHelper
-                .getGlobalInstance(IUserManager.class, this);
-        if (userManager != null) {
-            return userManager;
-        } else {
-            logger.error("UserManager Ref is null. ");
-            throw new InternalServerErrorException("UserManager Ref is null. ");
-        }
-    }
-
-}
diff --git a/opendaylight/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/WebSecurityContextRepository.java b/opendaylight/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/WebSecurityContextRepository.java
deleted file mode 100644 (file)
index 9f1c4a5..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.northbound.commons;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.security.core.context.SecurityContext;
-import org.springframework.security.web.context.HttpRequestResponseHolder;
-import org.springframework.security.web.context.SecurityContextRepository;
-
-import org.opendaylight.controller.sal.utils.ServiceHelper;
-import org.opendaylight.controller.usermanager.IUserManager;
-
-import org.opendaylight.controller.northbound.commons.exception.InternalServerErrorException;
-
-public class WebSecurityContextRepository implements SecurityContextRepository {
-
-    private static final Logger logger = LoggerFactory
-            .getLogger(WebSecurityContextRepository.class);
-
-    WebSecurityContextRepository() {
-    }
-
-    @Override
-    public SecurityContext loadContext(
-            HttpRequestResponseHolder requestResponseHolder) {
-
-        SecurityContextRepository contextRepo = (SecurityContextRepository) getUserManagerRef()
-                .getSecurityContextRepo();
-        return contextRepo.loadContext(requestResponseHolder);
-    }
-
-    @Override
-    public void saveContext(SecurityContext context,
-            HttpServletRequest request, HttpServletResponse response) {
-        SecurityContextRepository contextRepo = (SecurityContextRepository) getUserManagerRef()
-                .getSecurityContextRepo();
-        contextRepo.saveContext(context, request, response);
-    }
-
-    private IUserManager getUserManagerRef() {
-        IUserManager userManager = (IUserManager) ServiceHelper
-                .getGlobalInstance(IUserManager.class, this);
-        if (userManager != null) {
-            return userManager;
-        } else {
-            logger.error("UserManager Ref is null. ");
-            throw new InternalServerErrorException("UserManager Ref is null. ");
-        }
-    }
-
-    @Override
-    public boolean containsContext(HttpServletRequest request) {
-        SecurityContextRepository contextRepo = (SecurityContextRepository) getUserManagerRef()
-                .getSecurityContextRepo();
-        return contextRepo.containsContext(request);
-    }
-
-}
index c0f03edf5c11a1685b207ca874da5ad3e9b56ce7..1bfd4ebf12fd9a7e286557708d2aded63e26cfb9 100644 (file)
               org.opendaylight.controller.switchmanager,
               org.opendaylight.controller.northbound.commons,
               org.opendaylight.controller.northbound.commons.exception,
               org.opendaylight.controller.switchmanager,
               org.opendaylight.controller.northbound.commons,
               org.opendaylight.controller.northbound.commons.exception,
-              com.sun.jersey.spi.spring.container.servlet,
-              org.springframework.web.context,
-              org.springframework.web,
-              org.springframework.web.servlet,
-              org.springframework.web.filter,
-              org.springframework.security.config,
-              org.springframework.security.web.authentication,
-              org.springframework.security.web.authentication.www,
+              com.sun.jersey.spi.container.servlet,                            
               javax.ws.rs,
               javax.ws.rs.core,
               javax.xml.bind.annotation,
               javax.ws.rs,
               javax.ws.rs.core,
               javax.xml.bind.annotation,
diff --git a/opendaylight/northbound/flowprogrammer/src/main/resources/WEB-INF/spring/context.xml b/opendaylight/northbound/flowprogrammer/src/main/resources/WEB-INF/spring/context.xml
deleted file mode 100644 (file)
index 8a4bda5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xmlns:context="http://www.springframework.org/schema/context"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
-        <import resource="servlet/security.xml"/>
-
-</beans>
diff --git a/opendaylight/northbound/flowprogrammer/src/main/resources/WEB-INF/spring/servlet/security.xml b/opendaylight/northbound/flowprogrammer/src/main/resources/WEB-INF/spring/servlet/security.xml
deleted file mode 100644 (file)
index bce59ee..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<beans:beans xmlns="http://www.springframework.org/schema/security"
-       xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-           http://www.springframework.org/schema/security
-           http://www.springframework.org/schema/security/spring-security-3.1.xsd">
-
-       <http auto-config="false" authentication-manager-ref="authenticationManager"
-               security-context-repository-ref="securityContextRepo" entry-point-ref="authenticationEntryPoint">
-               <intercept-url pattern="/**"
-                       access="ROLE_SYSTEM-ADMIN, ROLE_NETWORK-ADMIN, ROLE_NETWORK-OPERATOR, ROLE_CONTAINER-USER" />
-               <custom-filter ref="restAuthenticationFilter" position="BASIC_AUTH_FILTER" />
-       </http>
-
-       <authentication-manager id="authenticationManager">
-               <authentication-provider ref="AuthenticationProviderWrapper" />
-       </authentication-manager>
-
-       <beans:bean id="restAuthenticationFilter"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationFilter">
-         <beans:property name="authenticationManager" ref="authenticationManager"/>
-         <beans:property name="authenticationEntryPoint" ref="authenticationEntryPoint"/>
-       </beans:bean>
-       
-       <beans:bean id="authenticationEntryPoint"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint">
-         <beans:property name="realmName" value="opendaylight"/>
-       </beans:bean>
-
-       <beans:bean id="securityContextRepo"
-               class="org.opendaylight.controller.northbound.commons.WebSecurityContextRepository" />
-
-       <beans:bean id="AuthenticationProviderWrapper"
-               class="org.opendaylight.controller.northbound.commons.AuthenticationProviderWrapper" />
-
-</beans:beans>
index df8cba156e513f29e6bbeefa58cf45cbbbbd5857..83f7e4b35d89e9891ef99e0cebd38ec17d45b213 100644 (file)
@@ -1,12 +1,11 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <?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>JAXRSFlowProgrammer</servlet-name>
   
        <servlet>
          <servlet-name>JAXRSFlowProgrammer</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.flowprogrammer.northbound.FlowProgrammerNorthboundRSApplication</param-value>
          <init-param>
            <param-name>javax.ws.rs.Application</param-name>
            <param-value>org.opendaylight.controller.flowprogrammer.northbound.FlowProgrammerNorthboundRSApplication</param-value>
@@ -18,27 +17,35 @@ http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
          <servlet-name>JAXRSFlowProgrammer</servlet-name>
          <url-pattern>/*</url-pattern>
        </servlet-mapping>
          <servlet-name>JAXRSFlowProgrammer</servlet-name>
          <url-pattern>/*</url-pattern>
        </servlet-mapping>
-       
-<!-- Spring Security related -->
-
-       <listener>
-       <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
-       </listener>
-
-       <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>
+       <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>
+    
+    <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>
        
        
-       <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>
\ No newline at end of file
 </web-app>
\ No newline at end of file
index 4cb9919b9c771a60d81418898f7f2b53c29b81a8..eab9fcb0c7a18531cf7aabe29fd853d67218ae90 100644 (file)
               com.sun.jersey.spi.container.servlet,
               org.opendaylight.controller.northbound.commons,
               org.opendaylight.controller.northbound.commons.exception,
               com.sun.jersey.spi.container.servlet,
               org.opendaylight.controller.northbound.commons,
               org.opendaylight.controller.northbound.commons.exception,
-              com.sun.jersey.spi.spring.container.servlet,
-              org.springframework.web.context,
-              org.springframework.web,
-              org.springframework.web.servlet,
-              org.springframework.web.filter,
-              org.springframework.security.config,
-              org.springframework.security.web.authentication,
-              org.springframework.security.web.authentication.www,
               javax.ws.rs,
               javax.ws.rs.core,
               javax.xml.bind.annotation,
               javax.ws.rs,
               javax.ws.rs.core,
               javax.xml.bind.annotation,
diff --git a/opendaylight/northbound/hosttracker/src/main/resources/WEB-INF/spring/context.xml b/opendaylight/northbound/hosttracker/src/main/resources/WEB-INF/spring/context.xml
deleted file mode 100644 (file)
index 8a4bda5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xmlns:context="http://www.springframework.org/schema/context"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
-        <import resource="servlet/security.xml"/>
-
-</beans>
diff --git a/opendaylight/northbound/hosttracker/src/main/resources/WEB-INF/spring/servlet/security.xml b/opendaylight/northbound/hosttracker/src/main/resources/WEB-INF/spring/servlet/security.xml
deleted file mode 100644 (file)
index bce59ee..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<beans:beans xmlns="http://www.springframework.org/schema/security"
-       xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-           http://www.springframework.org/schema/security
-           http://www.springframework.org/schema/security/spring-security-3.1.xsd">
-
-       <http auto-config="false" authentication-manager-ref="authenticationManager"
-               security-context-repository-ref="securityContextRepo" entry-point-ref="authenticationEntryPoint">
-               <intercept-url pattern="/**"
-                       access="ROLE_SYSTEM-ADMIN, ROLE_NETWORK-ADMIN, ROLE_NETWORK-OPERATOR, ROLE_CONTAINER-USER" />
-               <custom-filter ref="restAuthenticationFilter" position="BASIC_AUTH_FILTER" />
-       </http>
-
-       <authentication-manager id="authenticationManager">
-               <authentication-provider ref="AuthenticationProviderWrapper" />
-       </authentication-manager>
-
-       <beans:bean id="restAuthenticationFilter"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationFilter">
-         <beans:property name="authenticationManager" ref="authenticationManager"/>
-         <beans:property name="authenticationEntryPoint" ref="authenticationEntryPoint"/>
-       </beans:bean>
-       
-       <beans:bean id="authenticationEntryPoint"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint">
-         <beans:property name="realmName" value="opendaylight"/>
-       </beans:bean>
-
-       <beans:bean id="securityContextRepo"
-               class="org.opendaylight.controller.northbound.commons.WebSecurityContextRepository" />
-
-       <beans:bean id="AuthenticationProviderWrapper"
-               class="org.opendaylight.controller.northbound.commons.AuthenticationProviderWrapper" />
-
-</beans:beans>
index bfa9fc77c779ec98a227f5a85b849d069a0620e1..7eb940875a6b8af8366e4b4793418bcf3160149f 100644 (file)
@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <?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>JAXRSHostTracker</servlet-name>
   <servlet>
     <servlet-name>JAXRSHostTracker</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.hosttracker.northbound.HostTrackerNorthboundRSApplication</param-value>
     <init-param>
       <param-name>javax.ws.rs.Application</param-name>
       <param-value>org.opendaylight.controller.hosttracker.northbound.HostTrackerNorthboundRSApplication</param-value>
@@ -18,26 +17,34 @@ http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
     <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>
\ No newline at end of file
 </web-app>
\ No newline at end of file
index c35c5e622089c71bba297d9fa0142806e843b93c..eeaf550e6ba39b0d2ec7991532518bb1227429fe 100644 (file)
               com.sun.jersey.spi.container.servlet,
               org.opendaylight.controller.northbound.commons,
               org.opendaylight.controller.northbound.commons.exception,
               com.sun.jersey.spi.container.servlet,
               org.opendaylight.controller.northbound.commons,
               org.opendaylight.controller.northbound.commons.exception,
-              com.sun.jersey.spi.spring.container.servlet,
-              org.springframework.web.context,
-              org.springframework.web,
-              org.springframework.web.servlet,
-              org.springframework.web.filter,
-              org.springframework.security.config,
-              org.springframework.security.web.authentication,
-              org.springframework.security.web.authentication.www,
               org.slf4j,              
               javax.ws.rs,
               javax.ws.rs.core,
               org.slf4j,              
               javax.ws.rs,
               javax.ws.rs.core,
diff --git a/opendaylight/northbound/staticrouting/src/main/resources/WEB-INF/spring/context.xml b/opendaylight/northbound/staticrouting/src/main/resources/WEB-INF/spring/context.xml
deleted file mode 100644 (file)
index 8a4bda5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xmlns:context="http://www.springframework.org/schema/context"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
-        <import resource="servlet/security.xml"/>
-
-</beans>
diff --git a/opendaylight/northbound/staticrouting/src/main/resources/WEB-INF/spring/servlet/security.xml b/opendaylight/northbound/staticrouting/src/main/resources/WEB-INF/spring/servlet/security.xml
deleted file mode 100644 (file)
index bce59ee..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<beans:beans xmlns="http://www.springframework.org/schema/security"
-       xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-           http://www.springframework.org/schema/security
-           http://www.springframework.org/schema/security/spring-security-3.1.xsd">
-
-       <http auto-config="false" authentication-manager-ref="authenticationManager"
-               security-context-repository-ref="securityContextRepo" entry-point-ref="authenticationEntryPoint">
-               <intercept-url pattern="/**"
-                       access="ROLE_SYSTEM-ADMIN, ROLE_NETWORK-ADMIN, ROLE_NETWORK-OPERATOR, ROLE_CONTAINER-USER" />
-               <custom-filter ref="restAuthenticationFilter" position="BASIC_AUTH_FILTER" />
-       </http>
-
-       <authentication-manager id="authenticationManager">
-               <authentication-provider ref="AuthenticationProviderWrapper" />
-       </authentication-manager>
-
-       <beans:bean id="restAuthenticationFilter"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationFilter">
-         <beans:property name="authenticationManager" ref="authenticationManager"/>
-         <beans:property name="authenticationEntryPoint" ref="authenticationEntryPoint"/>
-       </beans:bean>
-       
-       <beans:bean id="authenticationEntryPoint"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint">
-         <beans:property name="realmName" value="opendaylight"/>
-       </beans:bean>
-
-       <beans:bean id="securityContextRepo"
-               class="org.opendaylight.controller.northbound.commons.WebSecurityContextRepository" />
-
-       <beans:bean id="AuthenticationProviderWrapper"
-               class="org.opendaylight.controller.northbound.commons.AuthenticationProviderWrapper" />
-
-</beans:beans>
index da8937e89f73c7413c4c70b237f9d38a5c3f1c4a..37901a68a8445536e06b87aafc502f12e275a3b8 100644 (file)
@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <?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>JAXRSStaticRouting</servlet-name>
   <servlet>
     <servlet-name>JAXRSStaticRouting</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.forwarding.staticrouting.northbound.StaticRoutingNorthboundRSApplication</param-value>
     <init-param>
       <param-name>javax.ws.rs.Application</param-name>
       <param-value>org.opendaylight.controller.forwarding.staticrouting.northbound.StaticRoutingNorthboundRSApplication</param-value>
@@ -13,30 +12,39 @@ http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
     <load-on-startup>1</load-on-startup>
   </servlet>
 
     <load-on-startup>1</load-on-startup>
   </servlet>
 
-  <servlet-mapping>
-    <servlet-name>JAXRSStaticRouting</servlet-name>
-    <url-pattern>/*</url-pattern>
-  </servlet-mapping>
-<!-- Spring Security related -->
+       <servlet-mapping>
+               <servlet-name>JAXRSStaticRouting</servlet-name>
+               <url-pattern>/*</url-pattern>
+       </servlet-mapping>
 
 
-       <listener>
-       <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
-       </listener>
+       <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>
 
 
-       <context-param>
-               <param-name>contextConfigLocation</param-name>
-               <param-value>/WEB-INF/spring/*.xml</param-value>
-       </context-param>
+       <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>
 
 
-       <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>
\ No newline at end of file
 </web-app>
\ No newline at end of file
index b3fe26f6a06ea884af140754561ea5c6c9d782c9..e10a5b1e1f08e7bde65dcda4f16fe1d26b61d6b2 100644 (file)
               com.sun.jersey.spi.container.servlet,
               org.opendaylight.controller.northbound.commons,
               org.opendaylight.controller.northbound.commons.exception,
               com.sun.jersey.spi.container.servlet,
               org.opendaylight.controller.northbound.commons,
               org.opendaylight.controller.northbound.commons.exception,
-              com.sun.jersey.spi.spring.container.servlet,
-              org.springframework.web.context,
-              org.springframework.web,
-              org.springframework.web.servlet,
-              org.springframework.web.filter,
-              org.springframework.security.config,
-              org.springframework.security.web.authentication,
-              org.springframework.security.web.authentication.www,
               javax.ws.rs,
               javax.ws.rs.core,
               javax.xml.bind.annotation,
               javax.ws.rs,
               javax.ws.rs.core,
               javax.xml.bind.annotation,
          <artifactId>commons.northbound</artifactId>
          <version>0.4.0-SNAPSHOT</version>
        </dependency>
          <artifactId>commons.northbound</artifactId>
          <version>0.4.0-SNAPSHOT</version>
        </dependency>
-        
-       <dependency>
-               <groupId>org.springframework</groupId>
-               <artifactId>spring-web</artifactId>
-               <version>${spring.version}</version>
-               <scope>provided</scope>
-       </dependency>
-
-       <dependency>
-               <groupId>org.springframework.security</groupId>
-               <artifactId>spring-security-config</artifactId>
-               <version>${spring-security.version}</version>
-               <scope>provided</scope>
-       </dependency>
-       
-       <dependency>
-               <groupId>org.springframework.security</groupId>
-               <artifactId>spring-security-web</artifactId>
-               <version>${spring-security.version}</version>
-               <scope>provided</scope>
-       </dependency>
-        
+    
     <dependency>
       <groupId>org.codehaus.enunciate</groupId>
       <artifactId>enunciate-core-annotations</artifactId>
     <dependency>
       <groupId>org.codehaus.enunciate</groupId>
       <artifactId>enunciate-core-annotations</artifactId>
diff --git a/opendaylight/northbound/statistics/src/main/resources/WEB-INF/spring/context.xml b/opendaylight/northbound/statistics/src/main/resources/WEB-INF/spring/context.xml
deleted file mode 100644 (file)
index 8a4bda5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xmlns:context="http://www.springframework.org/schema/context"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
-        <import resource="servlet/security.xml"/>
-
-</beans>
diff --git a/opendaylight/northbound/statistics/src/main/resources/WEB-INF/spring/servlet/security.xml b/opendaylight/northbound/statistics/src/main/resources/WEB-INF/spring/servlet/security.xml
deleted file mode 100644 (file)
index 768aafb..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<beans:beans xmlns="http://www.springframework.org/schema/security"
-       xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-           http://www.springframework.org/schema/security
-           http://www.springframework.org/schema/security/spring-security-3.1.xsd">
-
-       <http auto-config="false" authentication-manager-ref="authenticationManager"
-               security-context-repository-ref="securityContextRepo" entry-point-ref="authenticationEntryPoint">
-               <intercept-url pattern="/**"
-                       access="ROLE_SYSTEM-ADMIN, ROLE_NETWORK-ADMIN,ROLE_NETWORK-OPERATOR, ROLE_CONTAINER-USER" />
-               <custom-filter ref="restAuthenticationFilter" position="BASIC_AUTH_FILTER" />
-       </http>
-
-       <authentication-manager id="authenticationManager">
-               <authentication-provider ref="AuthenticationProviderWrapper" />
-       </authentication-manager>
-
-       <beans:bean id="restAuthenticationFilter"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationFilter">
-         <beans:property name="authenticationManager" ref="authenticationManager"/>
-         <beans:property name="authenticationEntryPoint" ref="authenticationEntryPoint"/>
-       </beans:bean>
-       
-       <beans:bean id="authenticationEntryPoint"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint">
-         <beans:property name="realmName" value="opendaylight"/>
-       </beans:bean>
-
-       <beans:bean id="securityContextRepo"
-               class="org.opendaylight.controller.northbound.commons.WebSecurityContextRepository" />
-
-       <beans:bean id="AuthenticationProviderWrapper"
-               class="org.opendaylight.controller.northbound.commons.AuthenticationProviderWrapper" />
-
-</beans:beans>
index 2b9f75f578e2e988800c457d877154b81d6e6c3b..24242d3c4587833e6a1db737ec7b5439722a79ce 100644 (file)
@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <?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>JAXRSStatistics</servlet-name>
   <servlet>
     <servlet-name>JAXRSStatistics</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.statistics.northbound.StatisticsNorthboundRSApplication</param-value>
     <init-param>
       <param-name>javax.ws.rs.Application</param-name>
       <param-value>org.opendaylight.controller.statistics.northbound.StatisticsNorthboundRSApplication</param-value>
@@ -18,26 +17,34 @@ http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
     <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>
\ No newline at end of file
 </web-app>
\ No newline at end of file
index aa18909f48af4a7681977d0e8cb09cc061fb932b..cfba4ffce9003569c224b3a932c738f151468e43 100644 (file)
               javax.ws.rs.core,
               javax.xml.bind.annotation,
               org.slf4j,
               javax.ws.rs.core,
               javax.xml.bind.annotation,
               org.slf4j,
-              com.sun.jersey.spi.spring.container.servlet,
-              org.springframework.web.context,
-              org.springframework.web,
-              org.springframework.web.servlet,
-              org.springframework.web.filter,
-              org.springframework.security.config,
-              org.springframework.security.web.authentication,
-              org.springframework.security.web.authentication.www,
               !org.codehaus.enunciate.jaxrs
             </Import-Package>
             <Export-Package>
               !org.codehaus.enunciate.jaxrs
             </Import-Package>
             <Export-Package>
diff --git a/opendaylight/northbound/subnets/src/main/resources/WEB-INF/spring/context.xml b/opendaylight/northbound/subnets/src/main/resources/WEB-INF/spring/context.xml
deleted file mode 100644 (file)
index 8a4bda5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xmlns:context="http://www.springframework.org/schema/context"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
-        <import resource="servlet/security.xml"/>
-
-</beans>
diff --git a/opendaylight/northbound/subnets/src/main/resources/WEB-INF/spring/servlet/security.xml b/opendaylight/northbound/subnets/src/main/resources/WEB-INF/spring/servlet/security.xml
deleted file mode 100644 (file)
index 768aafb..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<beans:beans xmlns="http://www.springframework.org/schema/security"
-       xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-           http://www.springframework.org/schema/security
-           http://www.springframework.org/schema/security/spring-security-3.1.xsd">
-
-       <http auto-config="false" authentication-manager-ref="authenticationManager"
-               security-context-repository-ref="securityContextRepo" entry-point-ref="authenticationEntryPoint">
-               <intercept-url pattern="/**"
-                       access="ROLE_SYSTEM-ADMIN, ROLE_NETWORK-ADMIN,ROLE_NETWORK-OPERATOR, ROLE_CONTAINER-USER" />
-               <custom-filter ref="restAuthenticationFilter" position="BASIC_AUTH_FILTER" />
-       </http>
-
-       <authentication-manager id="authenticationManager">
-               <authentication-provider ref="AuthenticationProviderWrapper" />
-       </authentication-manager>
-
-       <beans:bean id="restAuthenticationFilter"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationFilter">
-         <beans:property name="authenticationManager" ref="authenticationManager"/>
-         <beans:property name="authenticationEntryPoint" ref="authenticationEntryPoint"/>
-       </beans:bean>
-       
-       <beans:bean id="authenticationEntryPoint"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint">
-         <beans:property name="realmName" value="opendaylight"/>
-       </beans:bean>
-
-       <beans:bean id="securityContextRepo"
-               class="org.opendaylight.controller.northbound.commons.WebSecurityContextRepository" />
-
-       <beans:bean id="AuthenticationProviderWrapper"
-               class="org.opendaylight.controller.northbound.commons.AuthenticationProviderWrapper" />
-
-</beans:beans>
index b0fc9ee97a3563249205e296b5894542aa234b1a..1c201d3b33eb590ce57d70ac180c0abee48b6fba 100644 (file)
@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <?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>
     <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>
     <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>
     <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>
 </web-app>
index 4a8504bef09ac2918fb64325bae1fe01c2f81609..e4c73ac7431f75d3cbb13dc8b83fe7fe40365079 100644 (file)
               com.sun.jersey.spi.container.servlet,
               org.opendaylight.controller.northbound.commons,
               org.opendaylight.controller.northbound.commons.exception,
               com.sun.jersey.spi.container.servlet,
               org.opendaylight.controller.northbound.commons,
               org.opendaylight.controller.northbound.commons.exception,
-              com.sun.jersey.spi.spring.container.servlet,
-              org.springframework.web.context,
-              org.springframework.web,
-              org.springframework.web.servlet,
-              org.springframework.web.filter,
-              org.springframework.security.config,
-              org.springframework.security.web.authentication,
-              org.springframework.security.web.authentication.www,
               javax.ws.rs,
               javax.ws.rs.core,
               javax.xml.bind.annotation,
               javax.ws.rs,
               javax.ws.rs.core,
               javax.xml.bind.annotation,
                <version>${spring.version}</version>
                <scope>provided</scope>
        </dependency>
                <version>${spring.version}</version>
                <scope>provided</scope>
        </dependency>
-
-       <dependency>
-               <groupId>org.springframework.security</groupId>
-               <artifactId>spring-security-config</artifactId>
-               <version>${spring-security.version}</version>
-               <scope>provided</scope>
-       </dependency>
-       
-       <dependency>
-               <groupId>org.springframework.security</groupId>
-               <artifactId>spring-security-web</artifactId>
-               <version>${spring-security.version}</version>
-               <scope>provided</scope>
-       </dependency>
-        
+               
     <dependency>
       <groupId>org.codehaus.enunciate</groupId>
       <artifactId>enunciate-core-annotations</artifactId>
     <dependency>
       <groupId>org.codehaus.enunciate</groupId>
       <artifactId>enunciate-core-annotations</artifactId>
diff --git a/opendaylight/northbound/switchmanager/src/main/resources/WEB-INF/spring/context.xml b/opendaylight/northbound/switchmanager/src/main/resources/WEB-INF/spring/context.xml
deleted file mode 100644 (file)
index 8a4bda5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xmlns:context="http://www.springframework.org/schema/context"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
-        <import resource="servlet/security.xml"/>
-
-</beans>
diff --git a/opendaylight/northbound/switchmanager/src/main/resources/WEB-INF/spring/servlet/security.xml b/opendaylight/northbound/switchmanager/src/main/resources/WEB-INF/spring/servlet/security.xml
deleted file mode 100644 (file)
index 768aafb..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<beans:beans xmlns="http://www.springframework.org/schema/security"
-       xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-           http://www.springframework.org/schema/security
-           http://www.springframework.org/schema/security/spring-security-3.1.xsd">
-
-       <http auto-config="false" authentication-manager-ref="authenticationManager"
-               security-context-repository-ref="securityContextRepo" entry-point-ref="authenticationEntryPoint">
-               <intercept-url pattern="/**"
-                       access="ROLE_SYSTEM-ADMIN, ROLE_NETWORK-ADMIN,ROLE_NETWORK-OPERATOR, ROLE_CONTAINER-USER" />
-               <custom-filter ref="restAuthenticationFilter" position="BASIC_AUTH_FILTER" />
-       </http>
-
-       <authentication-manager id="authenticationManager">
-               <authentication-provider ref="AuthenticationProviderWrapper" />
-       </authentication-manager>
-
-       <beans:bean id="restAuthenticationFilter"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationFilter">
-         <beans:property name="authenticationManager" ref="authenticationManager"/>
-         <beans:property name="authenticationEntryPoint" ref="authenticationEntryPoint"/>
-       </beans:bean>
-       
-       <beans:bean id="authenticationEntryPoint"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint">
-         <beans:property name="realmName" value="opendaylight"/>
-       </beans:bean>
-
-       <beans:bean id="securityContextRepo"
-               class="org.opendaylight.controller.northbound.commons.WebSecurityContextRepository" />
-
-       <beans:bean id="AuthenticationProviderWrapper"
-               class="org.opendaylight.controller.northbound.commons.AuthenticationProviderWrapper" />
-
-</beans:beans>
index 697a7e359a910e22b23c6cd113168553f126cda3..a16cdfab48b88f228ae69ca3856f2c95a954bcca 100644 (file)
@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <?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>JAXRSSwitchManager</servlet-name>
   <servlet>
     <servlet-name>JAXRSSwitchManager</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.switchmanager.northbound.SwitchNorthboundRSApplication</param-value>
     <init-param>
       <param-name>javax.ws.rs.Application</param-name>
       <param-value>org.opendaylight.controller.switchmanager.northbound.SwitchNorthboundRSApplication</param-value>
@@ -18,26 +17,34 @@ http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
     <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>
\ No newline at end of file
 </web-app>
\ No newline at end of file
index 803fe404570687c9e625b1127439b56d6016e701..c31b478fb5dc6a91c687b16ea962976fbf65fc5f 100644 (file)
               javax.xml.bind,
               javax.xml.bind.annotation,
               org.slf4j,
               javax.xml.bind,
               javax.xml.bind.annotation,
               org.slf4j,
-              com.sun.jersey.spi.spring.container.servlet,
-              org.springframework.web.context,
-              org.springframework.web,
-              org.springframework.web.servlet,
-              org.springframework.web.filter,
-              org.springframework.security.config,
-              org.springframework.security.web.authentication,
-              org.springframework.security.web.authentication.www,
               !org.codehaus.enunciate.jaxrs
             </Import-Package>
             <Web-ContextPath>/controller/nb/v2/topology</Web-ContextPath>
               !org.codehaus.enunciate.jaxrs
             </Import-Package>
             <Web-ContextPath>/controller/nb/v2/topology</Web-ContextPath>
diff --git a/opendaylight/northbound/topology/src/main/resources/WEB-INF/spring/context.xml b/opendaylight/northbound/topology/src/main/resources/WEB-INF/spring/context.xml
deleted file mode 100644 (file)
index 8a4bda5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xmlns:context="http://www.springframework.org/schema/context"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
-        <import resource="servlet/security.xml"/>
-
-</beans>
diff --git a/opendaylight/northbound/topology/src/main/resources/WEB-INF/spring/servlet/security.xml b/opendaylight/northbound/topology/src/main/resources/WEB-INF/spring/servlet/security.xml
deleted file mode 100644 (file)
index 768aafb..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<beans:beans xmlns="http://www.springframework.org/schema/security"
-       xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-           http://www.springframework.org/schema/security
-           http://www.springframework.org/schema/security/spring-security-3.1.xsd">
-
-       <http auto-config="false" authentication-manager-ref="authenticationManager"
-               security-context-repository-ref="securityContextRepo" entry-point-ref="authenticationEntryPoint">
-               <intercept-url pattern="/**"
-                       access="ROLE_SYSTEM-ADMIN, ROLE_NETWORK-ADMIN,ROLE_NETWORK-OPERATOR, ROLE_CONTAINER-USER" />
-               <custom-filter ref="restAuthenticationFilter" position="BASIC_AUTH_FILTER" />
-       </http>
-
-       <authentication-manager id="authenticationManager">
-               <authentication-provider ref="AuthenticationProviderWrapper" />
-       </authentication-manager>
-
-       <beans:bean id="restAuthenticationFilter"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationFilter">
-         <beans:property name="authenticationManager" ref="authenticationManager"/>
-         <beans:property name="authenticationEntryPoint" ref="authenticationEntryPoint"/>
-       </beans:bean>
-       
-       <beans:bean id="authenticationEntryPoint"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint">
-         <beans:property name="realmName" value="opendaylight"/>
-       </beans:bean>
-
-       <beans:bean id="securityContextRepo"
-               class="org.opendaylight.controller.northbound.commons.WebSecurityContextRepository" />
-
-       <beans:bean id="AuthenticationProviderWrapper"
-               class="org.opendaylight.controller.northbound.commons.AuthenticationProviderWrapper" />
-
-</beans:beans>
index 9d2159979a1668b96181e058769182234c33bfc3..e40c5fbfbf63804c159f93505c7a6b9153af390d 100644 (file)
@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <?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>JAXRSTopology</servlet-name>
   <servlet>
     <servlet-name>JAXRSTopology</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.topology.northbound.TopologyNorthboundRSApplication</param-value>
     <init-param>
       <param-name>javax.ws.rs.Application</param-name>
       <param-value>org.opendaylight.controller.topology.northbound.TopologyNorthboundRSApplication</param-value>
@@ -17,26 +16,35 @@ http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
     <servlet-name>JAXRSTopology</servlet-name>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
     <servlet-name>JAXRSTopology</servlet-name>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
-<!-- Spring Security related -->
 
 
-       <listener>
-       <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
-       </listener>
+       <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>
 
 
-       <context-param>
-               <param-name>contextConfigLocation</param-name>
-               <param-value>/WEB-INF/spring/*.xml</param-value>
-       </context-param>
+       <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>
 
 
-       <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>
 </web-app>
index 2b9b1c448d34a56641930c15d1a98f1e09b81516..cabcf8d972bcbef0853bb13d6e08375cf61e0c7a 100644 (file)
                                com.sun.jersey.spi.container.servlet,
                                org.opendaylight.controller.northbound.commons,
                                org.opendaylight.controller.northbound.commons.exception,
                                com.sun.jersey.spi.container.servlet,
                                org.opendaylight.controller.northbound.commons,
                                org.opendaylight.controller.northbound.commons.exception,
-                               com.sun.jersey.spi.spring.container.servlet,
-                               org.springframework.web.context,
-                               org.springframework.web,
-                               org.springframework.web.servlet,
-                               org.springframework.web.filter,
-                               org.springframework.security.config,
-                               org.springframework.security.web.authentication,
-                               org.springframework.security.web.authentication.www,
                                javax.ws.rs,
                                javax.ws.rs.core,
                                javax.xml.bind.annotation,
                                javax.ws.rs,
                                javax.ws.rs.core,
                                javax.xml.bind.annotation,
diff --git a/opendaylight/samples/northbound/loadbalancer/src/main/resources/WEB-INF/spring/context.xml b/opendaylight/samples/northbound/loadbalancer/src/main/resources/WEB-INF/spring/context.xml
deleted file mode 100644 (file)
index 8a4bda5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xmlns:context="http://www.springframework.org/schema/context"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
-        <import resource="servlet/security.xml"/>
-
-</beans>
diff --git a/opendaylight/samples/northbound/loadbalancer/src/main/resources/WEB-INF/spring/servlet/security.xml b/opendaylight/samples/northbound/loadbalancer/src/main/resources/WEB-INF/spring/servlet/security.xml
deleted file mode 100644 (file)
index bce59ee..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<beans:beans xmlns="http://www.springframework.org/schema/security"
-       xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-           http://www.springframework.org/schema/security
-           http://www.springframework.org/schema/security/spring-security-3.1.xsd">
-
-       <http auto-config="false" authentication-manager-ref="authenticationManager"
-               security-context-repository-ref="securityContextRepo" entry-point-ref="authenticationEntryPoint">
-               <intercept-url pattern="/**"
-                       access="ROLE_SYSTEM-ADMIN, ROLE_NETWORK-ADMIN, ROLE_NETWORK-OPERATOR, ROLE_CONTAINER-USER" />
-               <custom-filter ref="restAuthenticationFilter" position="BASIC_AUTH_FILTER" />
-       </http>
-
-       <authentication-manager id="authenticationManager">
-               <authentication-provider ref="AuthenticationProviderWrapper" />
-       </authentication-manager>
-
-       <beans:bean id="restAuthenticationFilter"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationFilter">
-         <beans:property name="authenticationManager" ref="authenticationManager"/>
-         <beans:property name="authenticationEntryPoint" ref="authenticationEntryPoint"/>
-       </beans:bean>
-       
-       <beans:bean id="authenticationEntryPoint"
-         class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint">
-         <beans:property name="realmName" value="opendaylight"/>
-       </beans:bean>
-
-       <beans:bean id="securityContextRepo"
-               class="org.opendaylight.controller.northbound.commons.WebSecurityContextRepository" />
-
-       <beans:bean id="AuthenticationProviderWrapper"
-               class="org.opendaylight.controller.northbound.commons.AuthenticationProviderWrapper" />
-
-</beans:beans>
index 5011e748df23c59d3dbc5228534d91c6a9be90f9..365e4b22d6493a194ce273adc12b846ff1445606 100644 (file)
@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <?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>JAXRSLoadBalancer</servlet-name>
   <servlet>
     <servlet-name>JAXRSLoadBalancer</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.samples.loadbalancer.northbound.LoadBalancerNorthboundRSApplication</param-value>
     <init-param>
       <param-name>javax.ws.rs.Application</param-name>
       <param-value>org.opendaylight.controller.samples.loadbalancer.northbound.LoadBalancerNorthboundRSApplication</param-value>
@@ -18,26 +17,34 @@ http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
     <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>
 </web-app>