Skip to content

OAuth2TokenValidator examples use non existing method name for creating the NimbusJwtDecoder #6925

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

Closed
lgraf opened this issue May 31, 2019 · 2 comments
Assignees
Labels
in: docs An issue in Documentation or samples status: backported An issue that has been backported to maintenance branches
Milestone

Comments

@lgraf
Copy link
Contributor

lgraf commented May 31, 2019

Summary

The code examples for OAuth2TokenValidator use methods that are not exist, for creating a NimbusJwtDecoder/NimbusReactiveJwtDecoder.

This effects both validator examples (JwtTimestampValidator and custom AudienceValidator) in both documentations (servlet/reactive).

I have seen that changes to this api are planned (#6010), but i think this change can be helpful in the interim. If you like i provide a PR for adjusting the docs.

Actual Behavior

The docs use the method withOidcIssuerLocation(issuerUri) which does not exists.

NimbusJwtDecoder jwtDecoder = (NimbusJwtDecoder)
        JwtDecoders.withOidcIssuerLocation(issuerUri);

Servlet - JwtTimestampValidator example
Servlet - AudienceValidator example

NimbusReactiveJwtDecoder jwtDecoder = (NimbusReactiveJwtDecoder)
             ReactiveJwtDecoders.withOidcIssuerLocation(issuerUri);

Reactive - JwtTimestampValidator example
Reactive - AudienceValidator example

Sorry for using blame links, but i can't find a way to create a link to a line in file for (rendered) .adoc files.

Expected Behavior

The docs use the method fromOidcIssuerLocation(issuerUri)

NimbusJwtDecoder jwtDecoder = (NimbusJwtDecoder)
        JwtDecoders.fromOidcIssuerLocation(issuerUri);
NimbusReactiveJwtDecoder jwtDecoder = (NimbusReactiveJwtDecoder)
             ReactiveJwtDecoders.withOidcIssuerLocation(issuerUri);

Version

5.1.5.RELEASE / master

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 31, 2019
@jzheaux
Copy link
Contributor

jzheaux commented May 31, 2019

@lgraf, thanks for the report! Actually, I'll bet this is just a typo - I agree with your analysis that the examples should use fromOidcIssuerLocation.

Would you be interested in submitting a PR to fix that?

@jzheaux jzheaux added status: waiting-for-feedback We need additional information before we can continue in: docs An issue in Documentation or samples and removed status: waiting-for-triage An issue we've not yet triaged labels May 31, 2019
lgraf added a commit to lgraf/spring-security that referenced this issue May 31, 2019
@lgraf
Copy link
Contributor Author

lgraf commented May 31, 2019

@jzheaux i opened a PR where the method names are fixed (#6927).

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels May 31, 2019
@jzheaux jzheaux added this to the 5.2.0.M3 milestone Jun 13, 2019
@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.1.x labels Jun 13, 2019
@jzheaux jzheaux self-assigned this Jun 13, 2019
@rwinch rwinch removed the status: feedback-provided Feedback has been provided label Jun 17, 2019
rwinch added a commit that referenced this issue Jun 17, 2019
Fixes gh-6925

# Conflicts:
#	docs/manual/src/docs/asciidoc/_includes/servlet/preface/java-configuration.adoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: docs An issue in Documentation or samples status: backported An issue that has been backported to maintenance branches
Projects
None yet
Development

No branches or pull requests

4 participants