-
Notifications
You must be signed in to change notification settings - Fork 6k
Allow one to customize the AuthenticationConverter in BasicAuthenticationFilter #13988
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
PS I am happy to provide a PR here if you feel like this proposal might be appropriate to implement. |
Hi, @mmoayyed. Thanks for the report. I agree that the Are you able to create a PR that targets the |
Certainly, sure. Thank you. I'll try to put together something later today to be reviewed. |
Please see #13989 |
Extra note: the PR I put together allows AuthenticationConverter to be customizable via a setter. I would still maintain that the filter or (the converter) should allow one to customize the request matching functionality. I can of course do that separately if you think that might be a good idea. (I handle this atm with a custom converter). |
Expected Behavior
Presently in version
6.2.0-M3
, there is no possibility to customize theauthenticationConverter
that is provided byBasicAuthenticationFilter
, which means post-processing of the filter does not allow one to control the authentication conversion. Customizing the authentication converter allows one to decide where, when and how the filter should actually process a given request, i.e.:The proposal in summary is,
OidcLogoutAuthenticationConverter
, allow one to customize the request matching functionality.Current Behavior
Not possible to customize the authentication conversion process for this filter without reflection or a brand new filter. The main driver for this is to allow the filter match on certain requests, letting SS to handle those, while ignoring other (authenticated) requests and letting the app handle those.
Context
If HttpSecurity is configured for basic-authentication, it is not possible (or at least seems this way) to decide when and for which requests the basic auth filter should execute. Compared with
OidcLogoutAuthenticationConverter
one is given a customizable request matcher. In contrast, theBasicAuthenticationFilter
, matches on everything and anything that is able to produce the right kind of credentials. It seems impossible for the filter to back away, when a request contains credentials, allowing the app to handle that request. Perhaps that can be done using multiple filter chains, web customizers, etc all of which seem somewhat unnecessarily complex compared to the option here.As ever, thank you!
The text was updated successfully, but these errors were encountered: