tag:blogger.com,1999:blog-5294628283173395274.post7680878909359710625..comments2023-12-21T01:30:26.207-06:00Comments on Ramblings Of A Crazy DotNet Woman: How To Solve The anti-forgery token could not be decrypted. If this application is hosted by a Web Farm or cluster, ensure that all machines are running the same version of ASP.NET Web Pages and that the configuration specifies explicit encryption and validation keys. AutoGenerate cannot be used in a cluster. Error In Asp.Net MVC!Unknownnoreply@blogger.comBlogger20125tag:blogger.com,1999:blog-5294628283173395274.post-12144199640670874282020-05-20T01:29:21.752-05:002020-05-20T01:29:21.752-05:00Thanks for this post. If my app is hosted in a web...Thanks for this post. If my app is hosted in a webfarm under Load balancer, just wanted to check if we can configure the machine key in one server in IIS and copy the same to other server instead adding it manually to web.config file. Please adviseAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-75231680942427223612020-03-25T12:03:49.598-05:002020-03-25T12:03:49.598-05:00Thank you for this post....it REALLY helped me!!
...Thank you for this post....it REALLY helped me!! <br />BTW: I LOVE your style!!! You Rock <br /><br />"smooches"<br />JWJWhttps://www.blogger.com/profile/15742158737036239248noreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-50273570510823703172020-01-20T06:43:00.109-06:002020-01-20T06:43:00.109-06:00
I have checked my code i used single antiforgery ...<br />I have checked my code i used single antiforgery token. There is no duplication of key.Shoukat Malikhttps://www.blogger.com/profile/16378669689661010153noreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-79102806992938258812020-01-20T06:41:05.882-06:002020-01-20T06:41:05.882-06:00we are using request from multiple servers a few d...we are using request from multiple servers a few days before when i added csrf on login page .it giving the below error . <br /><br /> The anti-forgery token could not be decrypted. If this application is hosted by a Web Farm or cluster, ensure that all machines are running the same version of ASP.NET Web Pages and that the configuration specifies explicit encryption and validation keys. AutoGenerate cannot be used in a cluster., URL->https://akhbaar24.argaam.com/account/validateloginargaam, Controller -> account , at -> 1/5/2020 2:18:32 PM, Host -> 10.0.10.162, Client IP -> 94.200.83.222 ]]> configuration specifies explicit encryption and validation keys. AutoGenerate cannot be used in a cluster.<br /> at System.Web.Helpers.AntiXsrf.AntiForgeryTokenSerializer.Deserialize(String serializedToken)<br /> at System.Web.Helpers.AntiXsrf.AntiForgeryWorker.Validate(HttpContextBase httpContext)<br /> at System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor)<br /> at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.b__1e(AsyncCallback asyncCallback, Object asyncState)]]><log4j:locationInfo class="Akhbaar24_PP_Web.Controllers.BaseController" Shoukat Malikhttps://www.blogger.com/profile/16378669689661010153noreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-50610588097540795382019-10-03T03:12:06.788-05:002019-10-03T03:12:06.788-05:00I may be way too late to comment on this but have ...I may be way too late to comment on this but have a small question. I also came across this problem when redirected to the login page after session timed out. If we are to deploy the web application to a new environment. Shouldn't we do this manually on those environments as well ? like during deployment we have to add a manual step to go to IIS get the keys and update the keys in the web.config. Also what if the IIS in the new environment has configured to Automatically generate instead of fixed values.Ahamed Shaamilhttps://www.blogger.com/profile/12238000090197546639noreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-75681782339131120642018-10-20T02:09:36.071-05:002018-10-20T02:09:36.071-05:00I'm interested in reading this very much. Beca...I'm interested in reading this very much. Because this makes me know a lot of it. For anyone who wants to know this, read it.<br /><br /><br /><br /><a href="https://www.gclub-bet.com/" rel="nofollow">gclub</a>น้องส้มส้มhttps://www.blogger.com/profile/06673706046927661966noreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-46982801904841850922017-06-29T12:42:26.726-05:002017-06-29T12:42:26.726-05:00Great, in my case, remove ",IsolateApps"...Great, in my case, remove ",IsolateApps" from both keys to avoid a web.config compilation error Josephhttps://www.blogger.com/profile/05675428246922037383noreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-74460844284211499582016-10-24T05:39:06.508-05:002016-10-24T05:39:06.508-05:00I put the machine key in the web.config at the .NE...I put the machine key in the web.config at the .NET installation folder at C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config and removed the key in the solutions.Should this not mean that the same key is used across the apps in the server.But I am still getting this error.What could be the reason.Anonymoushttps://www.blogger.com/profile/13130399519941042769noreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-72360276797163039142016-05-13T03:40:39.895-05:002016-05-13T03:40:39.895-05:00Just wanted to say thanks - this solved my problem...Just wanted to say thanks - this solved my problem (almost)! Very helpful :-)<br /><br />When I generated the Hex code, I received an error "Decryption key specified has invalid hex characters". I fixed this by removing ",IsolateApps" from the string. More info here: http://stackoverflow.com/questions/15002960/isolateapps-causes-decryption-key-specified-has-invalid-hex-charactersAnonymoushttps://www.blogger.com/profile/17117490514588506183noreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-65759507666812107722015-09-11T05:09:22.753-05:002015-09-11T05:09:22.753-05:00kila mortan thanksssssssss....kila mortan thanksssssssss....Gururajhttp://google.comnoreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-55435211246604494522015-09-11T05:07:43.714-05:002015-09-11T05:07:43.714-05:00Thanks a lot guys ...
Thanks a lot guys ...<br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-39541341937603453682014-09-27T16:23:49.216-05:002014-09-27T16:23:49.216-05:00Hi guy, it's not work for me :(
I put the mach...Hi guy, it's not work for me :(<br />I put the machine key on my web.config, and run my application.. but, the same error is displayed when i'll login on the site...<br /><br />I created a topic on msdn (pt-br), if you can see, or ask me here what i need to do, i'll be very great, tks<br /><br />http://social.msdn.microsoft.com/Forums/pt-BR/0e4b8427-fc3e-4f2b-b782-d60ea3d2b7f7/the-antiforgery-token-could-not-be-decrypted-erro-aparece-com-machine-key-no-webconfig-?forum=mvcptAnonymoushttps://www.blogger.com/profile/00855039686303336666noreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-45027272017854560362014-07-18T10:31:40.238-05:002014-07-18T10:31:40.238-05:00Thanks for the post! Great tip!Thanks for the post! Great tip!Doremonhttps://www.blogger.com/profile/14870211394909595410noreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-45018071966223347022014-07-07T09:26:42.785-05:002014-07-07T09:26:42.785-05:00marry me. now.marry me. now.Phillip Springhttp://gatinhodosseussonhos.at.hotmail.comnoreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-89721943631592626222014-07-02T02:00:05.286-05:002014-07-02T02:00:05.286-05:00Many Thanks.It solved my problem and i'll awar...Many Thanks.It solved my problem and i'll aware of this problem as you explained the solution very clearly.<br />ThanksAnonymoushttps://www.blogger.com/profile/11974905101937086062noreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-39320298766318820152014-05-29T07:06:26.473-05:002014-05-29T07:06:26.473-05:00Hello Kila Morton,
After adding your given code i...Hello Kila Morton,<br /><br />After adding your given code in web.config file my site website gives me error. Kevin Rossnoreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-43547205772953621802014-03-18T01:38:41.199-05:002014-03-18T01:38:41.199-05:00Thanks a lot, I had @Html.AntiForgeryToken() in my...Thanks a lot, I had @Html.AntiForgeryToken() in my partial view and it made repeating the key. Once remeoved, problem solved.kevinnoreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-31858343479501292412014-02-18T09:02:07.031-06:002014-02-18T09:02:07.031-06:00Thanks a lot, you solved my problemThanks a lot, you solved my problemAnonymoushttps://www.blogger.com/profile/17922502807248048624noreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-12668805581060187232013-12-18T12:35:09.381-06:002013-12-18T12:35:09.381-06:00Hi Ikram!
You said that you already checked that t...Hi Ikram!<br />You said that you already checked that there are NOT multiple @Html.AntiForgeryToken() references, but I'm not convinced. So let me ask you something. <br />Do you have ANY Partials being referenced in your view? Did you check those partials to see if you included the AntiForgeryTokens in them? If you want real help, post another comment. You and I can converse and use some tool to allow you to show me your code. I could be wrong, but it sounds like you have a second token somewhere.Kila Mortonhttps://www.blogger.com/profile/14443998130029106925noreply@blogger.comtag:blogger.com,1999:blog-5294628283173395274.post-7415399854099513302013-12-18T10:48:47.218-06:002013-12-18T10:48:47.218-06:00I put a machine key in both of my project's we...I put a machine key in both of my project's web.config files and I already checked that there is no multiple @Html.AntiForgeryToken() . I have two projects developed in Asp.Net 4, when deployed locally give me fallowing error on first attempt and there is no problem on second time. I also delete the cookies and browsing history, just to make sure but same result. you can check my question on stackoverflow http://stackoverflow.com/questions/20655931/on-initial-login-on-local-site-getting-anti-forgery-cookie-token-error-when-try<br /><br />Any idea????Anonymoushttps://www.blogger.com/profile/01624251780121277885noreply@blogger.com