Revision history [back]

click to hide/show revision 1
initial version

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

ommpavan gravatar image ommpavan

retriving Spring authentication provider Name dynamically in multiple authentication providers

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

retriving Spring authentication provider Name dynamically in multiple authentication providers

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

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