Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
On click of browser back button i am getting an error:-

{"IDX10311: RequireNonce is 'true' (default) but validationContext.Nonce is null. A nonce cannot be validated. If you don't need to check the nonce, set OpenIdConnectProtocolValidator.RequireNonce to 'false'."} System.Exception {Microsoft.IdentityModel.Protocols.OpenIdConnectProtocolInvalidNonceException}

I have handeled this error type on gloabl.asax.cs file in Application_Error

by checking the error type.
(lastError.GetType() == typeof(OpenIdConnectProtocolInvalidNonceException))

in that im trying to redirect to home index view
My code:-

C#
if (lastError.GetType() == typeof(OpenIdConnectProtocolInvalidNonceException))  // & HttpContext.Current.IsCustomErrorEnabled)
            {
                HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
                HttpContext.Current.Response.Cache.SetValidUntilExpires(false);
                HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
                HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
                HttpContext.Current.Response.Cache.SetNoStore();

                Response.Clear();
                Server.ClearError();
                Response.Redirect("~/Home/Index");

            }


but still on click of browswer back button im getting error as :-
1. Confirm Form Resubmission on Crome browser
2. Webpage has expired on IE11 browser


please help
please help
Posted
Comments
Krunal Rohit 5-Nov-15 10:22am    
Rather redirect to Error page, and from there allow user to navigate to the Home page.

-KR

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900