File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
docs/manual/src/docs/asciidoc/_includes Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -464,10 +464,11 @@ static class GrantedAuthoritiesExtractor
464
464
implements Converter<Jwt, Collection<GrantedAuthority>> {
465
465
466
466
public Collection<GrantedAuthority> convert(Jwt jwt) {
467
- Collection<String > authorities = (Collection<String >)
468
- jwt.getClaims().get ("mycustomclaim");
467
+ Collection<? > authorities = (Collection<? >)
468
+ jwt.getClaims().getOrDefault ("mycustomclaim", Collections.emptyList() );
469
469
470
470
return authorities.stream()
471
+ .map(Object::toString)
471
472
.map(SimpleGrantedAuthority::new)
472
473
.collect(Collectors.toList());
473
474
}
Original file line number Diff line number Diff line change @@ -496,10 +496,11 @@ static class GrantedAuthoritiesExtractor
496
496
implements Converter<Jwt, Collection<GrantedAuthority>> {
497
497
498
498
public Collection<GrantedAuthority> convert(Jwt jwt) {
499
- Collection<String > authorities = (Collection<String >)
500
- jwt.getClaims().get ("mycustomclaim");
499
+ Collection<? > authorities = (Collection<? >)
500
+ jwt.getClaims().getOrDefault ("mycustomclaim", Collections.emptyList() );
501
501
502
502
return authorities.stream()
503
+ .map(Object::toString)
503
504
.map(SimpleGrantedAuthority::new)
504
505
.collect(Collectors.toList());
505
506
}
You can’t perform that action at this time.
0 commit comments