| author | ymh <ymh.work@gmail.com> |
| Wed, 04 Mar 2015 09:39:11 +0100 | |
| changeset 395 | 2e8c92eb0dfa |
| parent 316 | 242510015401 |
| permissions | -rw-r--r-- |
| 146 | 1 |
<beans xmlns="http://www.springframework.org/schema/beans" |
2 |
xmlns:security="http://www.springframework.org/schema/security" |
|
3 |
xmlns:util="http://www.springframework.org/schema/util" |
|
4 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
5 |
xsi:schemaLocation=" |
|
| 257 | 6 |
http://www.springframework.org/schema/beans |
7 |
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd |
|
8 |
http://www.springframework.org/schema/security |
|
9 |
http://www.springframework.org/schema/security/spring-security-3.2.xsd |
|
10 |
http://www.springframework.org/schema/util |
|
11 |
http://www.springframework.org/schema/util/spring-util-3.0.xsd" |
|
| 146 | 12 |
> |
13 |
||
|
149
554a7b55c29a
Simplify, put everythong in the same property file
ymh <ymh.work@gmail.com>
parents:
146
diff
changeset
|
14 |
<util:properties id="propsLocations"> |
|
554a7b55c29a
Simplify, put everythong in the same property file
ymh <ymh.work@gmail.com>
parents:
146
diff
changeset
|
15 |
<prop key="servletContextProps">WEB-INF/renkan.properties</prop> |
|
554a7b55c29a
Simplify, put everythong in the same property file
ymh <ymh.work@gmail.com>
parents:
146
diff
changeset
|
16 |
<prop key="classpathProps">classpath:renkan_run.properties</prop> |
| 146 | 17 |
</util:properties> |
18 |
|
|
19 |
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> |
|
20 |
<property name="order" value="1000"/> |
|
|
149
554a7b55c29a
Simplify, put everythong in the same property file
ymh <ymh.work@gmail.com>
parents:
146
diff
changeset
|
21 |
<property name="location" value="#{propsLocations.servletContextProps}"/> |
| 146 | 22 |
<property name="ignoreUnresolvablePlaceholders" value="true"/> |
23 |
<property name="IgnoreResourceNotFound" value="false"/> |
|
24 |
</bean> |
|
25 |
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> |
|
26 |
<property name="order" value="1"/> |
|
|
149
554a7b55c29a
Simplify, put everythong in the same property file
ymh <ymh.work@gmail.com>
parents:
146
diff
changeset
|
27 |
<property name="location" value="#{propsLocations.classpathProps}"/> |
| 146 | 28 |
<property name="ignoreUnresolvablePlaceholders" value="true"/> |
29 |
<property name="IgnoreResourceNotFound" value="true"/> |
|
| 226 | 30 |
</bean> |
| 231 | 31 |
|
32 |
<bean class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder" id="renkanPasswordEncoder"> |
|
33 |
<constructor-arg name="strength" value="10" type="int"/> |
|
34 |
</bean> |
|
| 226 | 35 |
|
| 231 | 36 |
<bean class="org.iri_research.renkan.services.RenkanUserDetailsService" id="renkanUserDetailsService" /> |
| 146 | 37 |
|
|
150
5b62100b8562
- replace simple http authentication by form auth
ymh <ymh.work@gmail.com>
parents:
149
diff
changeset
|
38 |
<security:http auto-config="true" use-expressions="true"> |
|
5b62100b8562
- replace simple http authentication by form auth
ymh <ymh.work@gmail.com>
parents:
149
diff
changeset
|
39 |
<security:intercept-url pattern="/admin" access="hasRole('ROLE_ADMIN')" /> |
| 225 | 40 |
<security:intercept-url pattern="/admin/**" access="hasRole('ROLE_ADMIN')" /> |
|
150
5b62100b8562
- replace simple http authentication by form auth
ymh <ymh.work@gmail.com>
parents:
149
diff
changeset
|
41 |
<security:form-login login-page="/auth/login" authentication-failure-url="/auth/loginfailed" password-parameter="password" username-parameter="username" /> |
|
5b62100b8562
- replace simple http authentication by form auth
ymh <ymh.work@gmail.com>
parents:
149
diff
changeset
|
42 |
<security:logout /> |
| 146 | 43 |
</security:http> |
44 |
|
|
| 225 | 45 |
<security:authentication-manager> |
| 231 | 46 |
<security:authentication-provider> |
47 |
<security:password-encoder hash="sha-256"/> |
|
| 146 | 48 |
<security:user-service> |
49 |
<security:user name="${user.admin.name}" password="${user.admin.password}" authorities="ROLE_ADMIN, ROLE_USER"/> |
|
| 231 | 50 |
</security:user-service> |
51 |
</security:authentication-provider> |
|
52 |
<security:authentication-provider user-service-ref='renkanUserDetailsService'> |
|
53 |
<security:password-encoder ref="renkanPasswordEncoder" /> |
|
54 |
</security:authentication-provider> |
|
| 146 | 55 |
</security:authentication-manager> |
| 231 | 56 |
<!--security:authentication-manager> |
57 |
<security:authentication-provider user-service-ref='renkanUserDetailsService'> |
|
58 |
<security:password-encoder ref="renkanPasswordEncoder" /> |
|
59 |
</security:authentication-provider> |
|
60 |
</security:authentication-manager--> |
|
61 |
||
| 146 | 62 |
|
63 |
</beans> |