source: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/springSecurity.xml @ 4997

Last change on this file since 4997 was 4997, checked in by olhsha@mpi.nl, 10 years ago

login-via-form

File size: 2.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3   
4    Copyright (C) 2013 DASISH
5   
6    This program is free software; you can redistribute it and/or
7    modify it under the terms of the GNU General Public License
8    as published by the Free Software Foundation; either version 2
9    of the License, or (at your option) any later version.
10   
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14    GNU General Public License for more details.
15   
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19   
20-->
21
22<beans xmlns="http://www.springframework.org/schema/beans"
23       xmlns:security="http://www.springframework.org/schema/security"
24       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
25       xsi:schemaLocation="http://www.springframework.org/schema/beans
26    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
27    http://www.springframework.org/schema/security
28    http://www.springframework.org/schema/security/spring-security-3.2.xsd">     
29   
30    <bean id="passwordEncoderBean" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder">
31        <constructor-arg value="512" />
32    </bean>
33   
34    <security:http>
35        <security:intercept-url pattern="/api/authentication/login" access="ROLE_USER" />
36        <security:form-login 
37            login-page="/loginform.jsp" 
38            default-target-url="/api" 
39            authentication-failure-url="/error.jsp" 
40            username-parameter="username"
41            password-parameter="password" />
42        <security:logout delete-cookies="JSESSIONID"  logout-success-url="/logout.jsp"/>
43    </security:http>
44   
45    <security:authentication-manager>
46        <security:authentication-provider>
47            <security:password-encoder ref="passwordEncoderBean">
48                <security:salt-source user-property="username"/>
49            </security:password-encoder>
50            <security:jdbc-user-service data-source-ref="dataSource"/>
51        </security:authentication-provider>
52    </security:authentication-manager> 
53     
54</beans>
55
56
57
Note: See TracBrowser for help on using the repository browser.