A logout response was unexpectedly received


I have implemented SAML SSO (high-level API) in web application. User is able to successfully login to the application with SSO.
On logout, successfully initiating SLO using SAMLServiceProvider.InitiateSLO method. But in SLOService.aspx page, i’m getting the error, ‘A logout response was unexpectedly received.’

I have attached log file generated during the SSO authentication and logout process.

Thank you for any advice.


Hi Lokesh
Thank you for including the log file.
By default, we store SAML SSO session information in the ASP.NET session.
It appears that your application is clearing or abandoning the ASP.NET session after calling SAMLServiceProvider.InitiateSLO.
When the logout response is received and you call SAMLServiceProvider.ReceiveSLO, we throw an exception as the knowledge of a pending logout response has been lost when the SAML SSO session information was cleared.
The recommendation is to not clear or abandon the ASP.NET session until after calling SAMLServiceProvider.ReceiveSLO.
If there’s specific application you wish to clear at the time you call SAMLServiceProvider.InitiateSLO then clear this specifically rather than clearing or abandoning the entire session.