-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add Assert.notNull() for AuthenticationProvider additions #530
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
Conversation
Add Assert.notNull() for AuthenticationProvider additions.
|
Thanks for the PR @gmazza. Could you also apply the same check to |
…orization-server into new-auth_provider_assertion
…orization-server into new-auth_provider_assertion
|
@jgrandja Hi, I added the check for the other three situations, and unit tests for all four. The latter I put in new separate classes away from the integration tests in the same package, let me know if you'd prefer them to be placed within the integration tests. (Incidentally, I built via ./gradlew clean build test, for some reason task checkstyleNohttp is failing, although my changes have nothing to do with the JavaScript files it found problems with, maybe this is a problem also in the main Spring repo. I needed to run with -x checkstyleNoHttp for the build to complete.) |
jgrandja
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates @gmazza. Please see review comments.
...ation/web/configurers/oauth2/server/authorization/OAuth2AuthorizationEndpointConfigurer.java
Outdated
Show resolved
Hide resolved
...ion/web/configurers/oauth2/server/authorization/OAuth2AuthorizationServerConfigurerTest.java
Outdated
Show resolved
Hide resolved
|
Apologies for the delay @gmazza and thanks for the updates! This is now merged to main. |
If we accidentally provide a null authenticationProvider configured via:
We get an NPE during the authenticationProviders.add(authenticationProvider) statement in Oauth2TokenEndpointConfigurer. The error stack is quite unclear where the NPE is coming from, requiring time-consuming IDE troubleshooting:
This PR adds an Assert.notNull, similar to many places elsewhere in the project, creating a much clearer stack trace: