Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

spring-security.xml

By: anidotnet on Jan 5th, 2013  |  syntax: XML  |  size: 2.31 KB  |  views: 30  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <beans:beans xmlns="http://www.springframework.org/schema/security"
  2.    xmlns:beans="http://www.springframework.org/schema/beans"
  3.    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4.    xsi:schemaLocation="http://www.springframework.org/schema/beans
  5.    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  6.    http://www.springframework.org/schema/security
  7.    http://www.springframework.org/schema/security/spring-security-3.1.xsd">
  8.  
  9.     <http pattern="/login*" security="none"/>
  10.     <http pattern="/favicon.ico" security="none"/>
  11.     <http pattern="/audit/create*" security="none"/>
  12.     <http pattern="/error" security="none"/>
  13.     <http pattern="/resources/**" security="none"/>
  14.  
  15.     <http auto-config='true' use-expressions="true">
  16.         <intercept-url pattern="/admin/**" access="hasRole('ROLE_ADMIN')"/>
  17.         <intercept-url pattern="/**" access="isAuthenticated()" />
  18.         <form-login login-page="/login" authentication-failure-url="/loginfailed" />
  19.         <logout logout-success-url="/logout" delete-cookies="JSESSIONID"/>
  20.         <access-denied-handler ref="accessDeniedHandler"/>
  21.     </http>
  22.  
  23.     <authentication-manager>
  24.        <authentication-provider>
  25.         <jdbc-user-service data-source-ref="cat-oracle-dataSource"
  26.  
  27.           users-by-username-query="
  28.              select username, password, 1
  29.              from users where username=?"
  30.  
  31.           authorities-by-username-query="
  32.              select u.username, ur.authority from users u, user_roles ur
  33.              where u.user_id = ur.user_id and u.username =?"
  34.  
  35.        />
  36.        </authentication-provider>
  37.     </authentication-manager>
  38.  
  39.     <beans:bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
  40.         <beans:property name="basenames">
  41.             <beans:list>
  42.                 <beans:value>properties.security-message</beans:value>
  43.             </beans:list>
  44.         </beans:property>
  45.     </beans:bean>
  46.  
  47.     <beans:bean id="accessDeniedHandler" class="org.cat.core.security.CATAccessHandler">
  48.         <beans:property name="accessDeniedUrl" value="/cat/error" />
  49.         <beans:property name="errorPropertyFile" value="properties/error.properties" />
  50.         <beans:property name="propertyManager" ref="propertyManager" />
  51.     </beans:bean>
  52.  
  53. </beans:beans>