public class AADJwtBearerTokenAuthenticationConverter extends AbstractJwtBearerTokenAuthenticationConverter
Converter that takes a Jwt and converts it into a BearerTokenAuthentication.converter, DEFAULT_PRINCIPAL_CLAIM_NAME, principalClaimName| Constructor and Description |
|---|
AADJwtBearerTokenAuthenticationConverter()
Construct AADJwtBearerTokenAuthenticationConverter by DEFAULT_PRINCIPAL_CLAIM_NAME and DEFAULT_CLAIM_TO_AUTHORITY_PREFIX_MAP.
|
AADJwtBearerTokenAuthenticationConverter(String authoritiesClaimName)
Construct AADJwtBearerTokenAuthenticationConverter with the authority claim.
|
AADJwtBearerTokenAuthenticationConverter(String principalClaimName,
Map<String,String> claimToAuthorityPrefixMap)
Using spring security provides JwtGrantedAuthoritiesConverter, it can resolve the access token of scp or roles.
|
AADJwtBearerTokenAuthenticationConverter(String authoritiesClaimName,
String authorityPrefix)
Construct AADJwtBearerTokenAuthenticationConverter with the authority claim name and prefix.
|
| Modifier and Type | Method and Description |
|---|---|
protected 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.
|
buildClaimToAuthorityPrefixMap, convert, setConverter, setPrincipalClaimNamepublic AADJwtBearerTokenAuthenticationConverter()
public AADJwtBearerTokenAuthenticationConverter(String authoritiesClaimName)
authoritiesClaimName - authority claim namepublic AADJwtBearerTokenAuthenticationConverter(String authoritiesClaimName, String authorityPrefix)
authoritiesClaimName - authority claim nameauthorityPrefix - the prefix name of the authoritypublic AADJwtBearerTokenAuthenticationConverter(String principalClaimName, Map<String,String> claimToAuthorityPrefixMap)
principalClaimName - authorities claim nameclaimToAuthorityPrefixMap - the authority name and prefix mapprotected org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal getAuthenticatedPrincipal(Map<String,Object> headers, Map<String,Object> claims, Collection<org.springframework.security.core.GrantedAuthority> authorities, String tokenValue)
AbstractJwtBearerTokenAuthenticationConvertergetAuthenticatedPrincipal in class AbstractJwtBearerTokenAuthenticationConverterheaders - Jwt header mapclaims - Jwt claims mapauthorities - Jwt authorities collectiontokenValue - Jwt token valueCopyright © 2021 Microsoft Corporation. All rights reserved.