Change Password and Logout from Sitecore CMS still allows to access /sitecore home page
Context:
Recently, I came across an interesting scenario from a Sitecore Slack channel thread that the home page is accessible after a user changes password and logs out of the CMS. So, I decided to simulate the issue in a local instance and I could do the same. So, instead of explaining the situation via words, here is a video that demonstrates the issue in a fresh 10.4 Sitecore instance:
Root Cause:
The root cause for the issue is, the application cookies for the domain were still accessible esp., the .ASPXAUTH session cookie:
Once I manually deleted the concerned application cookie, the authentication process would kick-in and display the login page automatically.
Fix:
By trial and error, I found that if I could invoke the FormsAuthentication Signout method, the cookie clearance would work fine, SignOut method is quite self-explanatory here below:
Now, all I had to do was patch the invocation call in a relevant processor and I chose to do before login as follows:
**************
Patch Config:
#############
#############
End-result:
Once you do the usual shenanigans of dll deployment to webroot bin folder and patch the config under site' App_config zzz folder, here is the end-result of the patch:
Github - ensure to publish dll and config file to correct webroot folder path
Comments
Post a Comment