how to get user entered password in spring security 3

335 Views Asked by At

I have implemented UserDetailsService and overriden loadUserByUsername(String username), here i need User entered password.

I want to authenticate against LdapTemplate authenticate(username,password). I have searched a lot but dint get it.

Please help me.

1

There are 1 best solutions below

0
On

Either use spring-security-ldap for LDAP based authentication or implement your own AuthenticationProvider instead of DaoAuthenticationProvider.

There are multiple authentication scenarios when using Spring Security LDAP:

  • either you can retrieve the user entry via connection authenticated by the provided credentials (probably scenario you are looking for)
  • or you can authenticate via technical account (usually you need to make LDAP search to get user's DN)

For more information check Spring Security LDAP documentation.