-
Notifications
You must be signed in to change notification settings - Fork 6k
The logoutFilter request matcher is hardcode to POST method #10311
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
There is deeper question about all the configurers, I understand that final classes ar hard to break, but why cannot be configurers overwritten is a mystery to me. I would like to propose considering not to make these classes final and open the for customization. But maybe I am just missing some aspect of possibility to customize it. |
I think we definitely want to encourage That said, I think that we can make this a little easier by allowing the filter to be post-processed as most other filters can already be. What's needed to do this is change // ...
LogoutFilter logoutFilter = new LogoutFilter(logoutRequestSuccessHandler, logoutHandlers);
logoutFilter.setLogoutRequestMatcher(createLogoutMatcher());
return postProcess(logoutFilter); Then, an application can do: http
.saml2Logout((saml2) -> saml2
.addObjectPostProcessor(new ObjectPostProcessor<LogoutFilter>() {
@Override public<O extends LogoutFilter> O postProcess(O object) {
object.setLogoutRequestMatcher(myRequestMatcher);
return object;
}
})
); to override the default to whatever request matching is needed. Would you be able to submit a PR to allow the logout filter to be post-processed? If you are able, it would also be nice to do it for the two other filters that are added by the DSL. |
yes postprocessing would solve my problem |
Hi @3rojka. |
Take it. |
Hi, @Erised. Is this something that you are still able to contribute? |
Hi @jzheaux, I use Spring security 5.8.3 and have a similar issue when using |
I have troubles with this hardcoded POST method, as in my application we do not post logout url and only use get, possibility to configure the matcher would be nice. At least I did not found a way to configure that. I had to copy the whole configurer and reimplement just this piece of code.
spring-security/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LogoutConfigurer.java
Line 278 in e9449be
The text was updated successfully, but these errors were encountered: