public class DefaultUserAuthenticationConverter extends Object implements UserAuthenticationConverter
UserAuthenticationConverter
. Converts to and from an Authentication using only its
name and authorities.AUTHORITIES, USERNAME
Constructor and Description |
---|
DefaultUserAuthenticationConverter() |
Modifier and Type | Method and Description |
---|---|
Map<String,?> |
convertUserAuthentication(org.springframework.security.core.Authentication authentication)
Extract information about the user to be used in an access token (i.e. for resource servers).
|
org.springframework.security.core.Authentication |
extractAuthentication(Map<String,?> map)
|
void |
setDefaultAuthorities(String[] defaultAuthorities)
Default value for authorities if an Authentication is being created and the input has no data for authorities.
|
void |
setUserDetailsService(org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
Optional
UserDetailsService to use when extracting an Authentication from the incoming map. |
public void setUserDetailsService(org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
UserDetailsService
to use when extracting an Authentication
from the incoming map.userDetailsService
- the userDetailsService to setpublic void setDefaultAuthorities(String[] defaultAuthorities)
extractAuthentication(Map)
will be unauthenticated.defaultAuthorities
- the defaultAuthorities to set. Default null.public Map<String,?> convertUserAuthentication(org.springframework.security.core.Authentication authentication)
UserAuthenticationConverter
convertUserAuthentication
in interface UserAuthenticationConverter
authentication
- an authentication representing a userpublic org.springframework.security.core.Authentication extractAuthentication(Map<String,?> map)
UserAuthenticationConverter
UserAuthenticationConverter.convertUserAuthentication(Authentication)
. Extracts an Authentication from a map.extractAuthentication
in interface UserAuthenticationConverter
map
- a map of user informationCopyright © 2019. All rights reserved.