1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:p="http://www.springframework.org/schema/p"
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.0.xsd">
<!-- annotation based security -->
<!-- JSR-250 annotation based security -->
<!-- Spring Security native annotation based security -->
<global-method-security secured-annotations="enabled"
jsr250-annotations="enabled"
pre-post-annotations="enabled">
<!-- Security Pointcut to all Services methods -->
<protect-pointcut expression="execution(* com.*.*Service.*(..))" access="ROLE_RDE"/>
</global-method-security>
<beans:bean id="authenticationSuccessHandler" class="com.security.AuthenticationSuccessHandlerImpl"
p:defaultTargetUrl="/secure/index.htm">
<beans:property name="userManagementService" ref="userManagementService"/>
<beans:property name="accountManagementService" ref="accountManagementService"/>
</beans:bean>
<beans:bean id="authenticationFailureHandler" class="com.security.AuthenticationFailureHandlerImpl"
p:defaultFailureUrl="/login.htm">
<beans:property name="userManagementService" ref="userManagementService"/>
</beans:bean>
<beans:bean id="authenticationSuccessHandlerReconnect" class="com.security.AuthenticationSuccessReconnectionHandlerImpl">
<beans:property name="userManagementService" ref="userManagementService"/>
<beans:property name="accountManagementService" ref="accountManagementService"/>
</beans:bean>
<beans:bean id="authenticationFailureHandlerReconnect" class="com.security.AuthenticationFailureReconnectionHandlerImpl">
<beans:property name="userManagementService" ref="userManagementService"/>
</beans:bean>
<beans:bean id="authenticationProvider"
class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
<beans:property name="passwordEncoder" ref="passwordEncoder"/>
<beans:property name="saltSource" ref="saltSource"/>
<beans:property name="userDetailsService" ref="userManagementService"/>
</beans:bean>
<authentication-manager alias="authenticationManager">
<authentication-provider ref="authenticationProvider">
<password-encoder ref="passwordEncoder"/>
</authentication-provider>
</authentication-manager>
<beans:bean id="authenticationFilter" class="com.security.UserNamePasswordTokenAuthenticationFilter">
<beans:property name="authenticationManager" ref="authenticationManager"/>
<beans:property name="filterProcessesUrl" value="/j_spring_security_check"/>
<beans:property name="authenticationSuccessHandler" ref="authenticationSuccessHandler"/>
<beans:property name="authenticationFailureHandler" ref="authenticationFailureHandler"/>
<beans:property name="userManagementService" ref="userManagementService"/>
</beans:bean>
<beans:bean id="authenticationEntryPoint"
class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint">
<beans:property name="loginFormUrl" value="/login.htm"/>
</beans:bean>
<beans:bean class="com.security.SecurityContextLogoutHandler"
name="logoutHandler">
</beans:bean>
<http entry-point-ref="authenticationEntryPoint" disable-url-rewriting="true">
<!--Restrict URLs based on role-->
<intercept-url pattern="/css/**" filters="none" requires-channel="https"/>
<intercept-url pattern="/js/**" filters="none" requires-channel="https"/>
<intercept-url pattern="/ext/**" filters="none" requires-channel="https"/>
<intercept-url pattern="/img/**" filters="none" requires-channel="https"/>
<intercept-url pattern="/userguide/**" access="IS_AUTHENTICATED_ANONYMOUSLY" requires-channel="https"/>
<intercept-url pattern="/login.htm*" access="IS_AUTHENTICATED_ANONYMOUSLY" requires-channel="https"/>
<!-- requires-channel="https"/> -->
<intercept-url pattern="/login.jsp*" access="ROLE_RDE" requires-channel="https"/>
<intercept-url pattern="/user/**" access="IS_AUTHENTICATED_ANONYMOUSLY" requires-channel="https"/>
<intercept-url pattern="/secure/**" access="ROLE_RDE" requires-channel="https"/>
<intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY" requires-channel="https"/>
<custom-filter position="FORM_LOGIN_FILTER" ref="authenticationFilter"/>
<session-management invalid-session-url="/reconnection.htm">
<!--<concurrency-control max-sessions="1" error-if-maximum-exceeded="true"/> -->
</session-management>
<logout logout-success-url="/login.htm"/>
</http>
<!--<http entry-point-ref="authenticationEntryPoint" disable-url-rewriting="true">-->
<!--<!–Restrict URLs based on role–>-->
<!--<intercept-url pattern="/css/**" filters="none" />-->
<!--<intercept-url pattern="/js/**" filters="none" />-->
<!--<intercept-url pattern="/ext/**" filters="none" />-->
<!--<intercept-url pattern="/img/**" filters="none" />-->
<!--<intercept-url pattern="/userguide/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />-->
<!--<intercept-url pattern="/login.htm*" access="IS_AUTHENTICATED_ANONYMOUSLY" />-->
<!--<!– requires-channel="https"/> –>-->
<!--<intercept-url pattern="/login.jsp*" access="ROLE_RDE" />-->
<!--<intercept-url pattern="/user/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />-->
<!--<intercept-url pattern="/secure/**" access="ROLE_RDE" />-->
<!--<intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />-->
<!--<custom-filter position="FORM_LOGIN_FILTER" ref="authenticationFilter"/>-->
<!--<session-management invalid-session-url="/login.htm">-->
<!--<!–<concurrency-control max-sessions="1" error-if-maximum-exceeded="true"/> –>-->
<!--</session-management>-->
<!--<logout logout-success-url="/login.htm"/>-->
<!--</http>-->
<!-- PasswordChecker Configuration -->
<beans:bean id="passwordChecker" class="com.security.password.impl.PasswordCheckerImpl">
<beans:property name="minLength" value="${security.passwordPolicy.minLength}"/>
<beans:property name="maxLength" value="${security.passwordPolicy.maxLength}"/>
<beans:property name="minDiffChars" value="${security.passwordPolicy.minDiffChars}"/>
<beans:property name="needUpperAndLowerCase" value="${security.passwordPolicy.needUpperAndLowerCase}"/>
<beans:property name="needNumbers" value="${security.passwordPolicy.needNumbers}"/>
<beans:property name="needChars" value="${security.passwordPolicy.needChars}"/>
<beans:property name="needSpecialCharacters" value="${security.passwordPolicy.needSpecialCharacters}"/>
<beans:property name="dictionaryCheck" value="${security.passwordPolicy.dictionaryCheck}"/>
<beans:property name="dictionaryWords" value="${security.passwordPolicy.dictionaryWords}"/>
</beans:bean>
<beans:bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder">
<beans:constructor-arg value="256"/>
</beans:bean>
<beans:bean id="saltSource" class="org.springframework.security.authentication.dao.SystemWideSaltSource">
<beans:property name="systemWideSalt" value="${security.saltSource}"/>
</beans:bean>
</beans:beans> |
Partager