How to fix browser back button issue after SAML SSO from Shibboleth
===

Have a SAML2 Service Provider web application build on .NET MVC (3). We are using ComponentSpace's SAML2 library to do the authentication, *not* the Shibboleth SP. Here is the relevant controller logic:

    public class SignOnController : Controller
    {
        // constructor-inject _services
    
        [HttpPost]
        public ActionResult SendAuthnRequest(string userName, string returnUrl)
        {
            // this users ComponentSpace internally to push user to IdP
            _services.SamlServiceProvider.SendAuthnRequest(args);
            return new EmptyResult();
        }
    
        [HttpPost]
        public ActionResult ReceiveAuthnResponse()
        {
            var samlResponse = _services.SamleServiceProvider
                .ReceiveSamlResponse(args);
            // ...
            return Redirect(samlResponse.RelayResourceUrl ?? defaultUrl);
        }
    }

Ultimately the user lands on either the relay url or the default login page. However when they click a link, then click the back button, the browser goes back to an error page on the Shibboleth IdP server. After that, the browser forward and back buttons ultimately become useless.

Am I doing something wrong in either of the above methods? Should I be returning a View() instead of an EmptyResult() when sending? Is there some way to reset the browser history to prevent repeated postbacks back to the IdP? Is this something that I can configure in ComponentSpace's implementation?