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

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

adding spring security tables, hashing and the method for posting record in the spring security tables

File size: 2.1 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:http-basic />
37        <security:logout delete-cookies="JSESSIONID"/>
38    </security:http>
39   
40    <security:authentication-manager>
41        <security:authentication-provider>
42            <security:password-encoder ref="passwordEncoderBean">
43                <security:salt-source user-property="username"/>
44            </security:password-encoder>
45            <security:jdbc-user-service data-source-ref="dataSource"/>
46        </security:authentication-provider>
47    </security:authentication-manager> 
48     
49</beans>
50
51
52
Note: See TracBrowser for help on using the repository browser.