I’m new to Spring, so this question may look like so obvious.
I’m trying to implement Spring security and my requirement is to authenticate the user name/password against a LDAP server and once the user is authenticated, I need to retrieve the user roles from a relational database.
is it possible to do this in Spring security?
Yes.
The build-in ldap authentication manager splits the authentication and authorisation of a user into 2 parts
You can configure a LDAP based authentiication manager like below.
The authentication provider is configured like this.
I don’t know if there’s a built-in populator that will do what you want, but you can develop your own one if required.