Skip to content

OAuth2ResourceServer configuration tests use deprecated extractAuthorities #6516

Closed

Description

@jzheaux

JwtAuthenticationConverter#extractAuthorities was deprecated in #6273 via 0f7dff3.

OAuth2ResourceServerConfigurerTests and OAuth2ResourceServerSpecTests should be updated to no longer use it, changing instead to use setJwtGrantedAuthoritiesConverter.

Activity

  1. added
    in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)
    status: first-timers-onlyAn issue that can only be worked on by brand new contributors
    on Feb 8, 2019
  2. vishalvrv9 commented on Feb 8, 2019

    @vishalvrv9
    Contributor

    Hey @jzheaux, haven't completely analyzed the issue but would like to work on it. Can I take this up?

  3. jzheaux commented on Feb 8, 2019

    @jzheaux
    CollaboratorAuthor

    Yep, it's yours! Feel free to ping me with any questions.

    When you are ready to push, check out the contribution guidelines.

  4. self-assigned this
    on Feb 8, 2019
  5. jzheaux commented on Feb 19, 2019

    @jzheaux
    CollaboratorAuthor

    @vishalvrv9 wanted to check in to see how things are going. Are there any questions I can answer for you?

  6. vishalvrv9 commented on Feb 23, 2019

    @vishalvrv9
    Contributor

    Hey @jzheaux ,
    firstly, apologies for the delay

    As per analysis,

    • In OAuth2ResourceServerSpecTests, since the method signature is different from extractAuthorities

    what should the implementation changes look like? Can you provide me a starting point as after trying to implement the setJwtGrantedAuthoritiesConverter I am a little lost

  7. jzheaux commented on Feb 28, 2019

    @jzheaux
    CollaboratorAuthor

    @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());
    + });
  8. jzheaux commented on May 14, 2019

    @jzheaux
    CollaboratorAuthor

    @vishalvrv9 Is this something that you'd still like to work on?

  9. vishalvrv9 commented on May 14, 2019

    @vishalvrv9
    Contributor

    Hey @jzheaux, Yeah definitely. Apologies lost track of it. Will try submitting a PR as soon as possible.

  10. vishalvrv9 commented on May 25, 2019

    @vishalvrv9
    Contributor

    @jzheaux have submitted PR #6904

  11. jzheaux commented on May 31, 2019

    @jzheaux
    CollaboratorAuthor

    Thanks, @vishalvrv9! I left a bit of feedback in the PR.

  12. vishalvrv9 commented on Jun 5, 2019

    @vishalvrv9
    Contributor

    Hey @jzheaux , worked on the feedback a couple of days back.

  13. jzheaux commented on Jun 12, 2019

    @jzheaux
    CollaboratorAuthor

    Fixed via b6e8997

  14. added this to the 5.2.0.M3 milestone on Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)type: enhancementA general enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions