applicationContext-security.xml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <b:beans xmlns="http://www.springframework.org/schema/security"
  3. xmlns:b="http://www.springframework.org/schema/beans"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  6. http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">
  7. <http pattern="/_ah/**" security="none"/>
  8. <http pattern="/static/**" security="none" />
  9. <http pattern="/favicon.ico" security="none" />
  10. <http pattern="/loggedout.htm" security="none" />
  11. <http pattern="/disabled.htm" security="none" />
  12. <http use-expressions="true" entry-point-ref="gaeEntryPoint">
  13. <intercept-url pattern="/" access="permitAll" />
  14. <intercept-url pattern="/logout.htm" access="permitAll" />
  15. <intercept-url pattern="/register.htm*" access="hasRole('NEW_USER')" />
  16. <intercept-url pattern="/**" access="hasRole('USER')" />
  17. <custom-filter position="PRE_AUTH_FILTER" ref="gaeFilter" />
  18. </http>
  19. <b:bean id="gaeEntryPoint" class="samples.gae.security.GoogleAccountsAuthenticationEntryPoint" />
  20. <b:bean id="gaeFilter" class="samples.gae.security.GaeAuthenticationFilter">
  21. <b:property name="authenticationManager" ref="authenticationManager"/>
  22. <b:property name="failureHandler">
  23. <b:bean class="org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler">
  24. <b:property name="exceptionMappings">
  25. <b:map>
  26. <b:entry key="org.springframework.security.authentication.DisabledException" value="/disabled.htm" />
  27. </b:map>
  28. </b:property>
  29. </b:bean>
  30. </b:property>
  31. </b:bean>
  32. <authentication-manager alias="authenticationManager">
  33. <authentication-provider ref="gaeAuthenticationProvider"/>
  34. </authentication-manager>
  35. <b:bean id="gaeAuthenticationProvider" class="samples.gae.security.GoogleAccountsAuthenticationProvider">
  36. <b:property name="userRegistry" ref="userRegistry" />
  37. </b:bean>
  38. <b:bean id="userRegistry" class="samples.gae.users.GaeDatastoreUserRegistry" />
  39. </b:beans>