November 2017
Intermediate to advanced
542 pages
14h 24m
English
One technique for populating user roles that are available to use with explicit bean configuration is implementing the support for looking up a user by username in UserDetailsService, and getting the GrantedAuthority objects from this source. The configuration is as simple as replacing the bean with the ldapAuthoritiesPopulator ID bean with an updated UserDetailsServiceLdapAuthoritiesPopulator object, with a reference to UserDetailsService. Make the following updates to the SecurityConfig.java file, ensuring you remove the previous ldapAuthoritiesPopulator bean definition:
//src/main/java/com/packtpub/springsecurity/configuration/SecurityConfig.java //@Bean //public LdapAuthoritiesPopulator ...
Read now
Unlock full access