0

retriving Spring authentication provider Name dynamically in multiple authentication providers

asked 2012-08-06 13:01:26 +0800

ommpavan gravatar image ommpavan
231

updated 2013-07-03 07:47:59 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

hai i am implementing spring security with two authentication providers
<authentication-manager erase-credentials="true">
<authentication-provider ref="ldapActiveDirectoryAuthProvider"/>
<authentication-provider user-service-ref="myUserDetailsService"/>
</authentication-manager>


in using spring AOP i am authenticating by below code

public Authentication loginLogging(ProceedingJoinPoint call) throws Throwable {
logger.debug("Entering ");
final Authentication authentication = (Authentication) call.getArgs()[0];

@SuppressWarnings("unused")
Object userObject= authentication.getPrincipal();
-------------------------------------------------------------------------------------------------------------------here i have to get authentication-provider ref Id
final Authentication result;
try {
result = (Authentication) call.proceed();
}catch{
s.o.p("authentication fail ");

}

It is working fine my requirement is
i have to get by which authentication-provider authentication is going /how to retirive authentication provider id dynamically .Can u provide sample code

delete flag offensive retag edit
Be the first one to reply this discussion!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-08-06 13:01:26 +0800

Seen: 118 times

Last updated: Aug 06 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More