Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans" xmlns:security="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- 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">
- <bean id="servletContextAttributeExporter" class="org.springframework.web.context.support.ServletContextAttributeExporter">
- <property name="attributes">
- <map>
- <entry key="AccountsClient" value-ref="accountsClient" />
- </map>
- </property>
- </bean>
- <security:authentication-manager alias="authenticationManager">
- <security:authentication-provider ref="clientProvider" />
- </security:authentication-manager>
- <!-- urls and security configuration -->
- <security:http pattern="/**" entry-point-ref="accountsEntryPoint">
- <security:custom-filter after="CAS_FILTER" ref="clientFilter" />
- <security:intercept-url pattern="/**" access="IS_AUTHENTICATED_FULLY" />
- </security:http>
- <!-- entry points -->
- <bean id="accountsEntryPoint" class="org.pac4j.springframework.security.web.ClientAuthenticationEntryPoint">
- <property name="client" ref="accountsClient" />
- </bean>
- <!-- clients definition -->
- <bean id="accountsClient" class="br.com.accounts.client.AccountsClient">
- <property name="key" value="${accounts.key}" />
- <property name="secret" value="${accounts.secret}" />
- <property name="baseUrl" value="${accounts.baseUrl}" />
- </bean>
- <bean id="clients" class="org.pac4j.core.client.Clients">
- <property name="callbackUrl" value="${accounts.callback}" />
- <property name="clients">
- <list>
- <ref bean="accountsClient" />
- </list>
- </property>
- </bean>
- <!-- common to all clients -->
- <bean id="clientFilter" class="org.pac4j.springframework.security.web.ClientAuthenticationFilter">
- <constructor-arg value="/callback"/>
- <property name="clients" ref="clients" />
- <property name="authenticationManager" ref="authenticationManager" />
- </bean>
- <bean id="clientProvider" class="org.pac4j.springframework.security.authentication.ClientAuthenticationProvider">
- <property name="clients" ref="clients" />
- </bean>
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment