Created
May 21, 2014 14:16
-
-
Save priyankahdp/0f1494bf405222736860 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:flex="http://www.springframework.org/schema/flex" xmlns:context="http://www.springframework.org/schema/context" | |
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc" | |
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/flex | |
http://www.springframework.org/schema/flex/spring-flex-1.0.xsd | |
http://www.springframework.org/schema/context | |
http://www.springframework.org/schema/context/spring-context-3.0.xsd | |
http://www.springframework.org/schema/tx | |
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd | |
http://www.springframework.org/schema/jdbc | |
http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd | |
http://www.springframework.org/schema/security | |
http://www.springframework.org/schema/security/spring-security-3.0.xsd"> | |
<import resource="databaseContext.xml" /> | |
<import resource="client-beans.xml" /> | |
<!-- <flex:message-broker> | |
<flex:remoting-service default-channels="my-amf"/> | |
</flex:message-broker> --> | |
<security:global-method-security | |
secured-annotations="enabled" jsr250-annotations="enabled" /> | |
<security:http auto-config="true"> | |
<security:anonymous enabled="false" /> | |
<security:intercept-url pattern="/cms-web-flex/*.swf*" | |
filters="none" /> | |
<security:intercept-url pattern="/cms-web-flex/home.html*" | |
access="ROLE_USER" /> | |
<security:intercept-url pattern="/jsf/*" | |
access="ROLE_USER" /> | |
<security:intercept-url pattern="/login.jsp" | |
filters="none" /> | |
<!-- default-target-url="/cms-web-flex/home.html --> | |
<security:form-login default-target-url="/jsf/home.jsf" | |
login-page="/login.jsp" always-use-default-target="true" /> | |
<security:logout invalidate-session="true" logout-url="/logout.html" | |
logout-success-url="/login.jsp" /> | |
</security:http> | |
<bean id="preAuthenticatedEntryPoint" | |
class="org.springframework.security.web.authentication.Http403ForbiddenEntryPoint" /> | |
<bean id="passwordEncoder" class="org.jasypt.spring.security3.PasswordEncoder"> | |
<property name="passwordEncryptor" ref="passwordEncriptor"></property> | |
</bean> | |
<security:authentication-manager> | |
<security:authentication-provider | |
user-service-ref="userDetailsServiceClient"> | |
<security:password-encoder ref="passwordEncoder"></security:password-encoder> | |
</security:authentication-provider> | |
</security:authentication-manager> | |
<bean id="userDetailsServiceClient" class="lk.dialog.ist.cms.service.UserDetailServiceImpl" /> | |
<!-- <bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider"> | |
<property name="userDetailsService" ref="userDetailsServiceClient" /> | |
</bean> | |
<bean id="providerManager" class="org.springframework.security.authentication.ProviderManager"> | |
<property name="providers"> | |
<list> | |
<ref local="daoAuthenticationProvider" /> | |
</list> | |
</property> | |
</bean> --> | |
</beans> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<bean id="userDetailsServiceClient" class="org.springframework.remoting.caucho.HessianProxyFactoryBean"> | |
<property name="serviceUrl" value="http://localhost:8081/cms-server/userDetailsServiceClient.http"/> | |
<property name="serviceInterface" value="lk.dialog.ist.cms.service.IUserDetailService"/> | |
<property name="username" value="${username}" /> | |
<property name="password" value="${password}" /> | |
</bean> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service("userDetailsServiceClient") | |
public class UserDetailServiceImpl implements UserDetailsService { | |
@Autowired | |
private SessionFactory sessionFactory; | |
@Autowired | |
private Assembler assembler; | |
@Autowired | |
private IUserDetailService userDetailsServiceClient; | |
@Override | |
@Transactional | |
public UserDetails loadUserByUsername(String userName) | |
throws UsernameNotFoundException, DataAccessException { | |
return userDetailsServiceClient.loadUserByUsername(userName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment