- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 MVC2 应用程序。我正在尝试实现 AntiForgeryToken 帮助程序来防止 CSRF 攻击。
我正在使用 Steve Sanderson 的博客实现这一点:http://blog.stevensanderson.com/2008/09/01/prevent-cross-site-request-forgery-csrf-using-aspnet-mvcs-antiforgerytoken-helper/
当我在新的 MVC2 项目中实现它时,它可以工作。但是当我把它放在我的真实应用程序中时,它总是抛出这个异常:
所需的防伪 token 未提供或无效。
这是我的 Controller 代码:
[ValidateAntiForgeryToken]
public ActionResult SubmitUpdate()
{
// Something goes here
return View();
}
<% using (Html.BeginForm("SubmitUpdate", "Test"))
{%>
<%= Html.AntiForgeryToken() %>
<input type="submit" value="Submit" />
<% } %>
最佳答案
您是否尝试删除 cookie 并重试?
关于asp.net-mvc - 防伪异常 : A required anti-forgery token was not supplied or was invalid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6792435/
当我尝试在 ASP.net Web 应用程序上运行性能测试时,我总是收到“防伪 cookie token 和表单字段 token 不匹配”。或者“无法解密防伪 token 。如果此应用程序由网络场或集
我有一个发布到 Azure 的 MVC Web 应用程序。由于在编辑 View 中包含@html.antiforgerytoken(),每当我单击编辑操作链接时,我都会收到错误。所以我删除了 View
我有 2 个 Web 应用程序项目,都位于 TFS 源代码管理中。第一个项目不会导致 AntiForgery token 出现问题。 这是错误 System.Web.WebPages.dll 中发生“
我有一个应该是 iFramed 的 MVC View 。它的多个实例可能在同一个主机页面中被 iFramed。在我看来,我有这个: @Html.AntiForgeryToken() 我用它来尝试确保对
我们使用 ASP.NET MVC 的默认防伪技术。最近一家安全公司对表格进行了扫描,并注意到他们可以多次使用相同的 _RequestVerificationToken 组合(cookie + 隐藏字段
我在使用防伪 token 时遇到问题 :(我已经创建了自己的 User 类,它运行良好,但现在每当我转到 /Account/Register 页面时都会收到错误消息。错误是: A claim of t
我正在使用 ASP.NET Identity 登录的应用程序中开发注销功能。我可以成功登录,但是当我注销然后尝试再次登录时,我收到以下消息: The provided anti-forgery tok
定义 ValidateAntiForgeryToken 属性时。盐的复杂度应该是多少? 例如,超过 X 个字符的字母数字字符是否合适?是否也应该有符号。 [ValidateAntiForgeryTok
我有一个问题,我最近在我的所有表单中都放置了防伪 token ,并在我的 Controller 中放置了 ValidateAntiForgeryToken 属性。 但我的用户经常填写表格,然后返回浏览
在没有 ssl 的情况下向服务器发出请求时,我实际上可以以纯文本形式看到 MVC3 框架生成的验证 token key 。 此 key 存储在名为:_RequestVerificationToken_
我们在 ASP.NET MVC 4 站点上使用 Amazon EC2 Elastic Beanstalk,并且在用户尝试登录后收到错误消息: The anti-forgery token could
我有一个表格: @using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl })) { @Html.AntiForgeryToken() @H
在 nim 中,jester 模块提供 Web API 服务,我对此表示感谢,但是我们是否支持跨站点防伪造 token ? (针对CSRF攻击) 就像 ASP.net 提供的那样。 最佳答案 没有。有
在 ASP.NET MVC 1.0 中,有一个新功能用于处理跨站请求伪造安全问题: [ValidateAntiForgeryToken] public ViewResult SubmitUpdat
我正在运行 IIS7、.NET 4.5 并且有一个 MVC2 站点。 我收到错误消息“此操作需要 IIS 集成管道模式。”当我导航到一个页面(一个 aspx View )时,上面有一个带有 AntiF
我收到以下错误: {"A claim of type 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier' or
我的 Web Api 站点有一个 AccountController,它使用登录的默认实现: // POST: /Account/Login [HttpPost] [AllowAnonymous] [
我正在尝试在 VS2012 中为 MVC 站点进行 Web 测试。 其中一种情况是登录并浏览产品列表,选择您想要的产品并进入购买页面。 问题是当 web 测试运行时,我收到一个关于防伪 token 的
您好,我可以像这样使用 vue js axios 将帖子发送到 Asp .NET Core 2.2 中的 Controller axios({
我正在使用 ELMAH 来处理我的 MVC 站点中的错误,并且在过去的几周里我注意到我抛出了一些 CryptographicExceptions。消息是: System.Security.Crypto
我是一名优秀的程序员,十分优秀!