-
Notifications
You must be signed in to change notification settings - Fork 6k
Document generic AuthenticationFilter class #9228
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
Comments
Is there any progress on this issue?👀 |
2025 now...still no update 😢 I have see @Kehrlann 's And no spring class is extends that class, the famous filter Also these two filter looks almost same, is there any design reason? |
Let me think about how to best document this. In the meantime, for those wondering about this class: The AuthenticationFilter is a user helper class, a commodity abstraction. Similar to AuthorityUtils, in a way. Neither of those are mentioned in the javadoc, and they are seldom[1] used in Spring Security itself. The
And that's it! There's actually very little code in the filter, it's mostly stringing the building blocks together, handling errors, saving authentication to the security context, and changing the session id. The user provides 5 functions and they will be correctly wired, instead of writing the same imperative logic. AbstractAuthenticationProcessingFilter, is different because, as the javadoc mentions, it is meant for browser-based http authentication, and supports, for example, simpler configuration for URL redirects on authentication failures, remember-me services and session management. It is not really designed for, say, machine-to-machine authentication. But mostly ... it's an older abstraction that most of spring security was built on top of (2004!) Today, I'd very likely go with Hope this is helpful. [1] Since |
Really helpful explanation, thanks! |
A generic AuthenticationFilter class was added in #6506 to v5.2, but there still isn't any documentation to explain why or how to use it.
Would it be ideal for a web API that uses a form of username/password authentication using custom headers (Client-ID, Client-Secret)? This feels like a simple use case but one that still appears to require a custom filter.
The text was updated successfully, but these errors were encountered: