Simple Load Balancer Application - Recommitting the source codewith the whole source...
[controller.git] / opendaylight / samples / northbound / loadbalancer / src / main / resources / WEB-INF / spring / servlet / security.xml
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
new file mode 100644 (file)
index 0000000..bce59ee
--- /dev/null
@@ -0,0 +1,36 @@
+<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>