Closed
Description
Summary
The Spring Security v5.2.0.M3 docs provides the following example:
static class GrantedAuthoritiesExtractor extends JwtAuthenticationConverter {
protected Collection<GrantedAuthority> extractAuthorities(Jwt jwt) {
Collection<String> authorities = (Collection<String>)
jwt.getClaims().get("mycustomclaim");
return authorities.stream()
.map(SimpleGrantedAuthority::new)
.collect(Collectors.toList());
}
}
The Collection<GrantedAuthority> extractAuthorities(Jwt jwt)
method is now deprecated. From looking at the source, it appears there's a new recommended way to introduce our own custom authority logic.