Class JsonPathJwtConverter
java.lang.Object
org.bremersee.spring.security.oauth2.server.resource.authentication.JsonPathJwtConverter
- All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>
public class JsonPathJwtConverter
extends Object
implements org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>
The json path jwt converter.
- Author:
- Christian Bremer
-
Constructor Summary
ConstructorsConstructorDescriptionJsonPathJwtConverter(JsonPathJwtProperties properties) Instantiates a new Json path jwt converter. -
Method Summary
Modifier and TypeMethodDescription@NonNull NormalizedJwtAuthenticationTokenconvert(@NonNull org.springframework.security.oauth2.jwt.Jwt source) Gets authorities from list.Gets authorities from value.protected StringgetEmail(JsonPathJwtParser parser) Gets email.protected StringgetFirstName(JsonPathJwtParser parser) Gets first name.protected Collection<? extends org.springframework.security.core.GrantedAuthority> Gets groups.protected Collection<Group> getGroups(JsonPathJwtParser parser) Gets groups.getGroupsFromList(JsonPathJwtParser parser) Gets groups from list.getGroupsFromValue(JsonPathJwtParser parser) Gets groups from value.protected StringgetLastName(JsonPathJwtParser parser) Gets last name.protected StringgetUsername(org.springframework.security.oauth2.jwt.Jwt source, JsonPathJwtParser parser) Gets username.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.core.convert.converter.Converter
andThen
-
Constructor Details
-
JsonPathJwtConverter
Instantiates a new Json path jwt converter.- Parameters:
properties- the properties
-
-
Method Details
-
convert
public @NonNull NormalizedJwtAuthenticationToken convert(@NonNull org.springframework.security.oauth2.jwt.Jwt source) - Specified by:
convertin interfaceorg.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>
-
getGrantedAuthorities
protected Collection<? extends org.springframework.security.core.GrantedAuthority> getGrantedAuthorities(JsonPathJwtParser parser) Gets groups.- Parameters:
parser- the parser- Returns:
- the groups
-
getAuthoritiesFromList
Gets authorities from list.- Parameters:
parser- the parser- Returns:
- the authorities from list
-
getAuthoritiesFromValue
Gets authorities from value.- Parameters:
parser- the parser- Returns:
- the authorities from value
-
getGroups
Gets groups.- Parameters:
parser- the parser- Returns:
- the groups
-
getGroupsFromList
Gets groups from list.- Parameters:
parser- the parser- Returns:
- the groups from list
-
getGroupsFromValue
Gets groups from value.- Parameters:
parser- the parser- Returns:
- the groups from value
-
getUsername
protected String getUsername(org.springframework.security.oauth2.jwt.Jwt source, JsonPathJwtParser parser) Gets username.- Parameters:
source- the sourceparser- the parser- Returns:
- the username
-
getFirstName
Gets first name.- Parameters:
parser- the parser- Returns:
- the first name
-
getLastName
Gets last name.- Parameters:
parser- the parser- Returns:
- the last name
-
getEmail
Gets email.- Parameters:
parser- the parser- Returns:
- the email
-