Package com.azure.spring.aad.webapi
Class AADJwtBearerTokenAuthenticationConverter
- java.lang.Object
-
- com.azure.spring.aad.webapi.AADJwtBearerTokenAuthenticationConverter
-
- All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>
- Direct Known Subclasses:
AADB2CJwtBearerTokenAuthenticationConverter
public class AADJwtBearerTokenAuthenticationConverter extends Object implements org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>
AConverterthat takes aJwtand converts it into aBearerTokenAuthentication.
-
-
Constructor Summary
Constructors Constructor Description AADJwtBearerTokenAuthenticationConverter()Construct AADJwtBearerTokenAuthenticationConverter by AADTokenClaim.SUB and DEFAULT_CLAIM_TO_AUTHORITY_PREFIX_MAP.AADJwtBearerTokenAuthenticationConverter(String authoritiesClaimName)Construct AADJwtBearerTokenAuthenticationConverter with the authority claim.AADJwtBearerTokenAuthenticationConverter(String authoritiesClaimName, String authorityPrefix)Construct AADJwtBearerTokenAuthenticationConverter with the authority claim name and prefix.AADJwtBearerTokenAuthenticationConverter(String principalClaimName, Map<String,String> claimToAuthorityPrefixMap)Using spring security provides JwtGrantedAuthoritiesConverter, it can resolve the access token of scp or roles.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.authentication.AbstractAuthenticationTokenconvert(org.springframework.security.oauth2.jwt.Jwt jwt)
-
-
-
Constructor Detail
-
AADJwtBearerTokenAuthenticationConverter
public AADJwtBearerTokenAuthenticationConverter()
Construct AADJwtBearerTokenAuthenticationConverter by AADTokenClaim.SUB and DEFAULT_CLAIM_TO_AUTHORITY_PREFIX_MAP.
-
AADJwtBearerTokenAuthenticationConverter
public AADJwtBearerTokenAuthenticationConverter(String authoritiesClaimName)
Construct AADJwtBearerTokenAuthenticationConverter with the authority claim.- Parameters:
authoritiesClaimName- authority claim name
-
AADJwtBearerTokenAuthenticationConverter
public AADJwtBearerTokenAuthenticationConverter(String authoritiesClaimName, String authorityPrefix)
Construct AADJwtBearerTokenAuthenticationConverter with the authority claim name and prefix.- Parameters:
authoritiesClaimName- authority claim nameauthorityPrefix- the prefix name of the authority
-
AADJwtBearerTokenAuthenticationConverter
public AADJwtBearerTokenAuthenticationConverter(String principalClaimName, Map<String,String> claimToAuthorityPrefixMap)
Using spring security provides JwtGrantedAuthoritiesConverter, it can resolve the access token of scp or roles.- Parameters:
principalClaimName- authorities claim nameclaimToAuthorityPrefixMap- the authority name and prefix map
-
-
Method Detail
-
convert
public org.springframework.security.authentication.AbstractAuthenticationToken convert(org.springframework.security.oauth2.jwt.Jwt jwt)
- Specified by:
convertin interfaceorg.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>
-
-