Skip to content
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

Fix DelegatingNegotiateSecurityFilter use of custom auth #956

Merged
merged 2 commits into from
Jun 11, 2020

Conversation

cmolodo
Copy link
Contributor

@cmolodo cmolodo commented Jun 11, 2020

For the SpringSecurity 4 and 5 modules DelegatingNegotiateSecurityFilter, if both a custom AuthenticationManager and a custom AuthenticationSuccessHandler are specified, the custom Authentication is added to the SecurityContext, but is not passed to the custom success handler.
This means the SecurityContext has a different Authentication token than the success handler.

This is fixed for both spring security modules.

Resolves #453

For the SpringSecurity 4 and 5 modules DelegatingNegotiateSecurityFilter, if both a custom AuthenticationManager and a custom AuthenticationSuccessHandler are specified, the custom Authentication is added to the SecurityContext, but is not passed to the custom success handler.  This means the context has a different Authentication than the success handler.

This is fixed for both spring security modules.

Issues:
Waffle#453
@dblock
Copy link
Collaborator

dblock commented Jun 11, 2020

🚀 This could use a test.

@cmolodo
Copy link
Contributor Author

cmolodo commented Jun 11, 2020

@dblock Sounds good, I'll add tests that check that the same custom Authentication token is now added to both the SecurityContext and the custom success handler.

Added unit tests to both Spring Security modules to check that the same authentication token provided by the custom AuthenticationManager is provided to both the SecurityContext and to the custom AuthenticationSuccessHandler.
@hazendaz
Copy link
Member

@cmolodo LGTM Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants