|
<?xml version="1.0" encoding="UTF-8"?> |
|
<beans xmlns="http://www.springframework.org/schema/beans" |
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
xmlns:security="http://www.springframework.org/schema/security" |
|
xmlns:util="http://www.springframework.org/schema/util" |
|
xsi:schemaLocation=" |
|
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd |
|
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd |
|
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd |
|
"> |
|
|
|
|
|
<security:authentication-manager alias="authManager"> |
|
<security:authentication-provider ref="socialAuthenticationProvider" /> |
|
</security:authentication-manager> |
|
|
|
<!-- START servlet filters --> |
|
<bean id="springSecurityFilter" class="org.springframework.security.web.FilterChainProxy"> |
|
<security:filter-chain-map path-type="ant"> |
|
<security:filter-chain pattern="/**" filters="httpSessionContextIntegrationFilter,socialAuthFilter" /> |
|
</security:filter-chain-map> |
|
</bean> |
|
|
|
<bean id="httpSessionContextIntegrationFilter" |
|
class="org.springframework.security.web.context.SecurityContextPersistenceFilter" /> |
|
|
|
<bean id="socialAuthFilter" class="org.springframework.social.security.SocialAuthenticationFilter"> |
|
<property name="authManager" ref="authManager" /> |
|
<property name="filterProcessesUrl" value="/auth" /> |
|
<property name="rememberMeServices" ref="rememberMeService" /> |
|
<property name="usersConnectionRepository" ref="usersConnectionRepository" /> |
|
<property name="userIdExtractor"> |
|
<bean class="org.example.UserAccountIdExtractor" /> |
|
</property> |
|
<property name="authServiceLocator" ref="connectionFactoryLocator" /> |
|
</bean> |
|
<!-- END servlet filters --> |
|
|
|
<!-- START social auth --> |
|
<bean id="socialAuthenticationProvider" class="org.springframework.social.security.SocialAuthenticationProvider"> |
|
<property name="usersConnectionRepository" ref="usersConnectionRepository" /> |
|
<property name="userDetailsService" ref="userDetailsService" /> |
|
</bean> |
|
|
|
<bean id="connectionFactoryRegistry" class="org.springframework.social.security.SocialAuthenticationServiceRegistry"> |
|
<property name="authenticationServices"> |
|
<util:list> |
|
<bean class="org.springframework.social.facebook.security.FacebookCookieAuthenticationService"> |
|
<property name="connectionFactory"> |
|
<bean class="org.springframework.social.facebook.connect.FacebookConnectionFactory"> |
|
<constructor-arg index="0" value="${org.example.facebook.appId}" /> |
|
<constructor-arg index="1" value="${org.example.facebook.secret}" /> |
|
</bean> |
|
</property> |
|
<property name="OAuthEnabled" value="true" /> |
|
<property name="appId" value="${org.example.facebook.appId}" /> |
|
<property name="appSecret" value="${org.example.facebook.secret}" /> |
|
</bean> |
|
<bean class="org.springframework.social.security.provider.OAuth1AuthenticationService"> |
|
<property name="connectionFactory"> |
|
<bean class="org.springframework.social.twitter.connect.TwitterConnectionFactory"> |
|
<constructor-arg index="0" value="${org.example.twitter.key}" /> |
|
<constructor-arg index="1" value="${org.example.twitter.secret}" /> |
|
</bean> |
|
</property> |
|
</bean> |
|
</util:list> |
|
</property> |
|
</bean> |
|
<alias name="connectionFactoryRegistry" alias="connectionFactoryLocator" /> |
|
<!-- END social auth --> |
|
|
|
</beans> |