-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OAuth2ResourceServer configuration tests use deprecated extractAuthorities #6516
Comments
Hey @jzheaux, haven't completely analyzed the issue but would like to work on it. Can I take this up? |
Yep, it's yours! Feel free to ping me with any questions. When you are ready to push, check out the contribution guidelines. |
@vishalvrv9 wanted to check in to see how things are going. Are there any questions I can answer for you? |
Hey @jzheaux , As per analysis,
what should the implementation changes look like? Can you provide me a starting point as after trying to implement the |
@vishalvrv9 no problem, my apologies for lagging in my response :) Something like this might work well: - JwtAuthenticationConverter converter = new JwtAuthenticationConverter() {
- @Override
- protected Collection<GrantedAuthority> extractAuthorities(Jwt jwt) {
- String[] claims = ((String) jwt.getClaims().get("scope")).split(" ");
- return Stream.of(claims).map(SimpleGrantedAuthority::new).collect(Collectors.toList());
- }
- };
+ JwtAuthenticationConverter converter = new JwtAuthenticationConverter();
+ converter.setJwtGrantedAuthoritiesConverter(jwt -> {
+ String[] claims = ((String) jwt.getClaims().get("scope")).split(" ");
+ return Stream.of(claims).map(SimpleGrantedAuthority::new).collect(Collectors.toList());
+ }); |
@vishalvrv9 Is this something that you'd still like to work on? |
Hey @jzheaux, Yeah definitely. Apologies lost track of it. Will try submitting a PR as soon as possible. |
Thanks, @vishalvrv9! I left a bit of feedback in the PR. |
Hey @jzheaux , worked on the feedback a couple of days back. |
Fixed via b6e8997 |
JwtAuthenticationConverter#extractAuthorities
was deprecated in #6273 via 0f7dff3.OAuth2ResourceServerConfigurerTests
andOAuth2ResourceServerSpecTests
should be updated to no longer use it, changing instead to usesetJwtGrantedAuthoritiesConverter
.The text was updated successfully, but these errors were encountered: