Try to search your question here, if you can't find : Ask Any Question Now ?

Multiple AuthenticationProvider with different UsernamePasswordAuthToken to authenticate different login forms without fallback authentication

HomeCategory: stackoverflowMultiple AuthenticationProvider with different UsernamePasswordAuthToken to authenticate different login forms without fallback authentication
Avatarkundan asked 1 week ago

While working with spring security I had a look at interesting thread in stackoverflow, there it was requirement to have authenticating two set of users against different authentication provider say employees against LDAP and customer against database. Thread came up with accepted solution to have a single login form with a radio button to distinguish employee from customer and to have custom authentication filter which differentiate login request based on userType and sets different authenticationToken(customerAuthToken/employeeAuthToken) and request is proceeded for authentication. There will be two AuthenticationProvider implementation and authentication is done and decided by supporting token.
In this way thread was able to provide interesting solution to avoid fallback authentication which spring security provides by default.

Have a look at thread Configuring Spring Security 3.x to have multiple entry points

Since answer is completely in xml configuration. I just wanted to have the solution be available in java configuration. I will be posting that in answer.

Now my question, with evolution of spring version, is it possible to have the same functionality by any new features/ minimal configurations apart from my answer?

1 Answers
Best Answer
AvatarFernando answered 1 week ago
Your Answer

1 + 15 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com