November 2017
Intermediate to advanced
542 pages
14h 24m
English
UserDetailsWrapper was deprecated in favor of using RoleHierarchyAuthoritiesMapper. Typically it users would not use the UserDetailsWrapper class directly. However, if they are, they can use RoleHierarchyAuthoritiesMapper, for example, the following code may be present:
UserDetailsWrapper authenticate = new UserDetailsWrapper (userDetails, roleHiearchy);
If so, then it needs to be replaced by the following code snippet:
Collection<GrantedAuthority> allAuthorities = roleHiearchy. getReachableGrantedAuthorities(userDetails.getAuthorities()); UserDetails authenticate = new User(userDetails.getUsername(), userDetails.getPassword(), allAuthorities);
Read now
Unlock full access