2012-02-12 02:55:42 -03:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
|
|
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
|
|
xmlns:sec="http://www.springframework.org/schema/security"
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
2020-11-07 11:56:38 -08:00
|
|
|
http://www.springframework.org/schema/beans/spring-beans.xsd
|
2012-02-12 02:55:42 -03:00
|
|
|
http://www.springframework.org/schema/security
|
2020-11-07 11:56:38 -08:00
|
|
|
http://www.springframework.org/schema/security/spring-security.xsd">
|
2012-02-21 16:36:19 -03:00
|
|
|
|
2022-02-12 08:04:16 -08:00
|
|
|
<bean id="custom-firewall" class="org.springframework.security.web.firewall.StrictHttpFirewall">
|
|
|
|
<property name="allowSemicolon" value="true"/>
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
<sec:http-firewall ref="custom-firewall"/>
|
|
|
|
|
|
|
|
|
2021-12-24 18:03:23 -08:00
|
|
|
<sec:http pattern="/static/webapp/**" security="none"/>
|
|
|
|
<sec:http pattern="/static/mindplot/**" security="none"/>
|
2012-02-12 21:57:11 -03:00
|
|
|
<sec:http pattern="/css/**" security="none"/>
|
|
|
|
<sec:http pattern="/js/**" security="none"/>
|
|
|
|
<sec:http pattern="/images/**" security="none"/>
|
2012-02-21 14:22:43 -03:00
|
|
|
<sec:http pattern="/icons/**" security="none"/>
|
2012-06-03 11:16:38 -03:00
|
|
|
|
|
|
|
<sec:http pattern="/c/home" security="none"/>
|
2012-06-18 00:40:42 -03:00
|
|
|
|
2012-06-03 20:23:31 -03:00
|
|
|
<sec:http pattern="/c/maps/*/embed" security="none"/>
|
2012-08-26 16:53:33 -03:00
|
|
|
<sec:http pattern="/c/maps/*/try" security="none"/>
|
2012-06-18 00:40:42 -03:00
|
|
|
<sec:http pattern="/c/maps/*/public" security="none"/>
|
2013-02-07 21:44:20 -03:00
|
|
|
<sec:http pattern="/c/restful/maps/*/document/xml-pub" security="none"/>
|
2012-06-21 22:18:04 -03:00
|
|
|
|
2012-06-18 00:40:42 -03:00
|
|
|
<sec:http pattern="/c/publicview.htm" security="none"/>
|
|
|
|
<sec:http pattern="/c/embeddedview.htm" security="none"/>
|
|
|
|
<sec:http pattern="/c/termsOfUse" security="none"/>
|
2012-06-03 20:23:31 -03:00
|
|
|
<sec:http pattern="/c/activation" security="none"/>
|
2012-06-18 00:40:42 -03:00
|
|
|
|
2021-12-24 18:03:23 -08:00
|
|
|
<!-- Admin related services that required admin role-->
|
2012-11-10 17:19:28 -03:00
|
|
|
<sec:http use-expressions="true" create-session="stateless" pattern="/service/**">
|
2022-02-19 12:39:38 -08:00
|
|
|
<sec:csrf/>
|
2020-11-06 21:35:54 -08:00
|
|
|
|
2021-12-24 18:03:23 -08:00
|
|
|
<!-- Enabled only for cors -->
|
|
|
|
<sec:intercept-url pattern="/service/users" method="OPTIONS" access="permitAll"/>
|
|
|
|
<sec:intercept-url pattern="/service/users/resetPassword" method="OPTIONS" access="permitAll"/>
|
|
|
|
|
2022-02-19 15:57:57 -08:00
|
|
|
|
2021-12-24 18:03:23 -08:00
|
|
|
<sec:intercept-url pattern="/service/users/" method="POST" access="permitAll"/>
|
|
|
|
<sec:intercept-url pattern="/service/users/resetPassword" method="PUT" access="permitAll"/>
|
|
|
|
|
2012-02-21 14:22:43 -03:00
|
|
|
<sec:intercept-url pattern="/service/admin/users/**" access="isAuthenticated() and hasRole('ROLE_ADMIN')"/>
|
2013-03-24 15:42:25 -03:00
|
|
|
<sec:intercept-url pattern="/service/admin/database/**" access="isAuthenticated() and hasRole('ROLE_ADMIN')"/>
|
2012-06-18 01:15:46 -03:00
|
|
|
<sec:intercept-url pattern="/service/**" access="isAuthenticated() and hasRole('ROLE_USER')"/>
|
2021-12-24 18:03:23 -08:00
|
|
|
|
2012-02-12 21:57:11 -03:00
|
|
|
<sec:http-basic/>
|
|
|
|
</sec:http>
|
2012-02-12 02:55:42 -03:00
|
|
|
|
2022-02-19 12:39:38 -08:00
|
|
|
<sec:http use-expressions="true" pattern="/c/**/*">
|
|
|
|
<sec:intercept-url pattern="/c/login" access="hasRole('ANONYMOUS')"/>
|
|
|
|
<sec:intercept-url pattern="/c/logout" access="hasRole('ANONYMOUS')"/>
|
|
|
|
<sec:intercept-url pattern="/c/registration" access="hasRole('ANONYMOUS')"/>
|
2022-02-19 12:43:35 -08:00
|
|
|
<sec:intercept-url pattern="/c/registration-success" access="hasRole('ANONYMOUS')"/>
|
2022-02-19 12:39:38 -08:00
|
|
|
<sec:intercept-url pattern="/c/forgot-password" access="hasRole('ANONYMOUS')"/>
|
2022-02-19 12:43:35 -08:00
|
|
|
<sec:intercept-url pattern="/c/forgot-password-success" access="hasRole('ANONYMOUS')"/>
|
|
|
|
|
2012-06-18 01:15:46 -03:00
|
|
|
<sec:intercept-url pattern="/c/**/*" access="isAuthenticated() and hasRole('ROLE_USER')"/>
|
2022-02-19 12:39:38 -08:00
|
|
|
<sec:access-denied-handler error-page="/c/login"/>
|
2012-06-03 11:16:38 -03:00
|
|
|
<sec:form-login login-page="/c/login"
|
2012-11-10 17:19:28 -03:00
|
|
|
authentication-success-handler-ref="authenticationSuccessHandler"
|
|
|
|
always-use-default-target="false"
|
2012-06-03 11:16:38 -03:00
|
|
|
authentication-failure-url="/c/login?login_error=2"
|
2020-11-06 21:35:54 -08:00
|
|
|
login-processing-url="/c/perform-login"/>
|
2013-03-10 19:07:52 -03:00
|
|
|
|
2021-12-24 18:03:23 -08:00
|
|
|
<!-- Expire in 28 days -->
|
2022-02-19 12:39:38 -08:00
|
|
|
<sec:remember-me token-validity-seconds="2419200" remember-me-parameter="remember-me"/>
|
2012-06-03 11:16:38 -03:00
|
|
|
<sec:logout logout-url="/c/logout" invalidate-session="true" logout-success-url="/c/login"/>
|
2022-02-19 15:57:57 -08:00
|
|
|
<sec:csrf request-matcher-ref="requestMatcher"/>
|
2012-02-12 02:55:42 -03:00
|
|
|
</sec:http>
|
|
|
|
|
2022-02-19 15:57:57 -08:00
|
|
|
<!-- Extends CFSR check to get methods to have consistency in all errors. Otherwise, request is forward in some cases -->
|
|
|
|
<bean id="requestMatcher"
|
|
|
|
class="com.wisemapping.security.CSFRRequestMatcher">
|
|
|
|
<property name="prefix" value="/c/restful/"/>
|
2022-02-19 12:39:38 -08:00
|
|
|
</bean>
|
|
|
|
|
2013-02-17 23:10:04 -03:00
|
|
|
<import resource="wisemapping-security-${security.type}.xml"/>
|
2012-02-12 02:55:42 -03:00
|
|
|
|
2012-02-21 16:36:19 -03:00
|
|
|
<bean id="userDetailsService" class="com.wisemapping.security.UserDetailsService">
|
2012-06-23 16:15:59 -03:00
|
|
|
<property name="userService" ref="userService"/>
|
2012-02-21 16:36:19 -03:00
|
|
|
<property name="adminUser" value="${admin.user}"/>
|
2012-02-12 02:55:42 -03:00
|
|
|
</bean>
|
2012-11-10 17:19:28 -03:00
|
|
|
|
|
|
|
<bean id="authenticationSuccessHandler" class="com.wisemapping.security.AuthenticationSuccessHandler">
|
|
|
|
<property name="defaultTargetUrl" value="/c/maps/"/>
|
|
|
|
<property name="alwaysUseDefaultTargetUrl" value="false"/>
|
|
|
|
</bean>
|
2013-02-17 21:00:08 -03:00
|
|
|
|
2012-02-12 02:55:42 -03:00
|
|
|
</beans>
|