This repository has been archived by the owner on Feb 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
security.xml
104 lines (87 loc) · 5.06 KB
/
security.xml
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
<beans xmlns:sec="http://www.springframework.org/schema/security"
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd">
<bean id="userService"
class="org.greengin.nquireit.logic.users.UserServiceBean">
</bean>
<bean id="securityContextRepository"
class="org.springframework.security.web.context.HttpSessionSecurityContextRepository"/>
<bean id="rememberMeServices"
class="org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices">
<property name="userDetailsService" ref="userService"/>
<property name="tokenValiditySeconds" value="3600"/><!--VAR: tokenValiditySeconds (NDF) -->
<property name="cookieName" value="NQUIRE_IT_TOKEN"/>
<property name="key" value="xxxxxxx"/>
</bean>
<sec:http auto-config="true">
<sec:session-management>
<sec:concurrency-control session-registry-alias="sessionRegistry"/>
</sec:session-management>
</sec:http>
<bean id="passwordEncoder"
class="org.springframework.security.crypto.password.StandardPasswordEncoder">
<constructor-arg value="${security.encodingSecret}"/>
</bean>
<sec:authentication-manager alias="authenticationManager">
<sec:authentication-provider user-service-ref="userService">
<sec:password-encoder ref="passwordEncoder"/>
</sec:authentication-provider>
</sec:authentication-manager>
<bean id="textEncryptor" class="org.springframework.security.crypto.encrypt.Encryptors"
factory-method="text">
<constructor-arg value="${security.encryptPassword}"/>
<constructor-arg value="${security.encryptSalt}"/>
</bean>
<bean name="socialInAdapter" class="org.greengin.nquireit.logic.users.SocialAdapter"/>
<bean id="usersConnectionRepository" class="org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository">
<constructor-arg ref="dataSource"/>
<constructor-arg ref="connectionFactoryLocator"/>
<constructor-arg ref="textEncryptor"/>
<property name="connectionSignUp" ref="socialInAdapter"/>
</bean>
<bean id="connectionRepository" factory-method="createConnectionRepository" factory-bean="usersConnectionRepository"
scope="request">
<constructor-arg value="#{request.userPrincipal.name}"/>
<aop:scoped-proxy proxy-target-class="false"/>
</bean>
<bean id="connectionFactoryLocator" class="org.springframework.social.connect.support.ConnectionFactoryRegistry">
<property name="connectionFactories">
<list>
<bean class="org.springframework.social.google.connect.GoogleConnectionFactory">
<constructor-arg value="${google.consumerKey}"/>
<constructor-arg value="${google.consumerSecret}"/>
</bean>
<bean class="org.springframework.social.facebook.connect.FacebookConnectionFactory">
<constructor-arg value="${facebook.clientId}"/>
<constructor-arg value="${facebook.clientSecret}"/>
</bean>
<bean class="org.springframework.social.twitter.connect.TwitterConnectionFactory">
<constructor-arg value="${twitter.consumerKey}"/>
<constructor-arg value="${twitter.consumerSecret}"/>
</bean>
</list>
</property>
</bean>
<bean id="facebook" factory-bean="connectionRepository" factory-method="findPrimaryConnection" scope="request">
<constructor-arg value="org.springframework.social.facebook.api.Facebook"/>
<aop:scoped-proxy proxy-target-class="false"/>
</bean>
<bean id="google" factory-bean="connectionRepository" factory-method="findPrimaryConnection" scope="request">
<constructor-arg value="org.springframework.social.google.api.Google"/>
<aop:scoped-proxy proxy-target-class="true"/>
</bean>
<bean id="twitter" factory-bean="connectionRepository" factory-method="findPrimaryConnection" scope="request">
<constructor-arg value="org.springframework.social.twitter.api.Twitter"/>
<aop:scoped-proxy proxy-target-class="true"/>
</bean>
<bean class="org.greengin.nquireit.controllers.users.CustomProviderSignInController2">
<property name="applicationUrlBase" value="${server.appUrl}"/>
<property name="signUpUrl" value="${server.appUrl}/social/new"/>
<property name="signInUrl" value="${server.appUrl}/social/signin"/>
<property name="postSignInUrl" value="${server.appUrl}/social/welcome"/>
</bean>
</beans>