|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright 2002-2021 the original author or authors.
|
|
|
+ * Copyright 2002-2022 the original author or authors.
|
|
|
*
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
* you may not use this file except in compliance with the License.
|
|
@@ -40,26 +40,12 @@ public class JwtAuthenticationConverter implements Converter<Jwt, AbstractAuthen
|
|
|
|
|
|
@Override
|
|
|
public final AbstractAuthenticationToken convert(Jwt jwt) {
|
|
|
- Collection<GrantedAuthority> authorities = extractAuthorities(jwt);
|
|
|
+ Collection<GrantedAuthority> authorities = this.jwtGrantedAuthoritiesConverter.convert(jwt);
|
|
|
|
|
|
String principalClaimValue = jwt.getClaimAsString(this.principalClaimName);
|
|
|
return new JwtAuthenticationToken(jwt, authorities, principalClaimValue);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Extracts the {@link GrantedAuthority}s from scope attributes typically found in a
|
|
|
- * {@link Jwt}
|
|
|
- * @param jwt The token
|
|
|
- * @return The collection of {@link GrantedAuthority}s found on the token
|
|
|
- * @deprecated Since 5.2. Use your own custom converter instead
|
|
|
- * @see JwtGrantedAuthoritiesConverter
|
|
|
- * @see #setJwtGrantedAuthoritiesConverter(Converter)
|
|
|
- */
|
|
|
- @Deprecated
|
|
|
- protected Collection<GrantedAuthority> extractAuthorities(Jwt jwt) {
|
|
|
- return this.jwtGrantedAuthoritiesConverter.convert(jwt);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Sets the {@link Converter Converter<Jwt, Collection<GrantedAuthority>>}
|
|
|
* to use. Defaults to {@link JwtGrantedAuthoritiesConverter}.
|