Description
Describe the bug
I was following the spring logout documentation as in link below
and i ran in IllegalArgumentException error when i started the application when configuring the logout handler.
https://docs.spring.io/spring-security/reference/servlet/authentication/logout.html#clear-all-site-data
Apparently this is updated in the code documentation that the arguments should not be null or empty, but not on the website.
To Reproduce
HeaderWriterLogoutHandler clearSiteData = new HeaderWriterLogoutHandler(new ClearSiteDataHeaderWriter());
http
.logout((logout) -> logout.addLogoutHandler(clearSiteData))
Expected behavior
The above configuration clears out all site data as stated in the documentation.
Probably the wanted behavior can be achieved if we provide the ClearSiteDataHeaderWriter.Directive.ALL as argument.
Solution would be updating the website documentation to:
HeaderWriterLogoutHandler clearSiteData = new HeaderWriterLogoutHandler(new ClearSiteDataHeaderWriter(ClearSiteDataHeaderWriter.Directive.ALL));
http
.logout((logout) -> logout.addLogoutHandler(clearSiteData))
Sample
Starting the sample below will throw the IllegalArgumentException since we are not providing any Directive as agrument.
[A link to a GitHub repository with a minimal, reproducible sample.](https://github.com/ivopogace/IAE)