Hello Puneet,
I guess your question is how to use your own UserDetailsService?
all you have to do is declare a class which implements UserDetailsManager
PHP Code:
public class YourClass implements UserDetailsManager{
/*If you wish you can customize and populate UserDetails as well generally it will have UserName,
Password (may not be available always), GrantedAuthority[] etc */
public UserDetails loadUserByUsername(String userName){
}
}
In the applicationContext.xml the following is the configuration.
PHP Code:
<bean id="userServiceImpl" class="com.xyz.security. YourClass " >
<!-- Any Ioc's if you want-->
</bean>
<!--You can use any authentication provider here only thing that you should notice is authentication providers will take userDetailsService -->
<bean id="authenticationProvider"
class="org.springframework.security.providers.cas.CasAuthenticationProvider">
<security:custom-authentication-provider/>
<property name="userDetailsService" ref="userServiceImpl"/>
<property name="serviceProperties" ref="serviceProperties"/>
<property name="ticketValidator">
<bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
<constructor-arg index="0" value="https://${com.xyz.abc.cas.server.name}/cas"/>
<property name="proxyGrantingTicketStorage" ref="proxyGrantingTicketStorage"/>
<property name="proxyCallbackUrl" value="http://${com.xyz.abc.cas.server.name}/secure/receptor"/>
</bean>
</property>
<property name="key" value="an_id_for_this_auth_provider_only"/>
</bean>
Regards,
Giridhar Duggirala