public abstract class AbstractJwtBearerTokenAuthenticationConverter extends Object implements org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>
Converter that takes a Jwt and converts it into a BearerTokenAuthentication.| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>> |
converter |
static String |
DEFAULT_PRINCIPAL_CLAIM_NAME |
protected String |
principalClaimName |
| Constructor and Description |
|---|
AbstractJwtBearerTokenAuthenticationConverter(String principalClaimName,
Map<String,String> claimToAuthorityPrefixMap) |
| Modifier and Type | Method and Description |
|---|---|
protected static Map<String,String> |
buildClaimToAuthorityPrefixMap(String authoritiesClaimName,
String authorityPrefix) |
org.springframework.security.authentication.AbstractAuthenticationToken |
convert(org.springframework.security.oauth2.jwt.Jwt jwt) |
protected abstract org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal |
getAuthenticatedPrincipal(Map<String,Object> headers,
Map<String,Object> claims,
Collection<org.springframework.security.core.GrantedAuthority> authorities,
String tokenValue)
Construct an instance of OAuth2AuthenticatedPrincipal interface.
|
void |
setConverter(org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>> converter) |
void |
setPrincipalClaimName(String principalClaimName) |
public static final String DEFAULT_PRINCIPAL_CLAIM_NAME
protected org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>> converter
protected String principalClaimName
public org.springframework.security.authentication.AbstractAuthenticationToken convert(org.springframework.security.oauth2.jwt.Jwt jwt)
convert in interface org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>protected static Map<String,String> buildClaimToAuthorityPrefixMap(String authoritiesClaimName, String authorityPrefix)
protected abstract org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal getAuthenticatedPrincipal(Map<String,Object> headers, Map<String,Object> claims, Collection<org.springframework.security.core.GrantedAuthority> authorities, String tokenValue)
headers - Jwt header mapclaims - Jwt claims mapauthorities - Jwt authorities collectiontokenValue - Jwt token valuepublic void setConverter(org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>> converter)
public void setPrincipalClaimName(String principalClaimName)
Copyright © 2021 Microsoft Corporation. All rights reserved.