Drupal 中的 CSRF 验证失败 [英] CSRF validation failed in Drupal

查看:25
本文介绍了Drupal 中的 CSRF 验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Drupal 7 中使用网络服务.如果我尝试使用 海报 我收到CSRF 验证失败".之前,我连接了一个管理员帐户.

我使用 Firefox 插件海报.>

我该如何解决这个问题?

解决方案

需要在服务请求的头部传递CSRF令牌.

要检索令牌,请导航到:

http://www.example.com/?q=services/session/token

将令牌复制到剪贴板.

然后在 FireFox 海报中,使用标题"选项卡,添加此名称和值:

  • 名称:X-CSRF-Token
  • 值:[在此处粘贴令牌值]

现在,当您发出请求时,令牌将与 FireFox 海报一起正确传递.

以下是概述此主题的详细博客文章:

http://tylerfrankenstein.com/code/drupal-services-csrf-token-firefox-海报

I'm using a webservice in Drupal 7. If I try to use Poster I get 'CSRF validation failed'. Before, I was connected with an administrator account.

I use the Firefox add-in Poster.

How can I fix this problem?

解决方案

You need to pass along the CSRF token in the header of the service request.

To retrieve the token, navigate to:

http://www.example.com/?q=services/session/token

Copy the token to your clipboard.

Then in FireFox poster, using the "Headers" tab, add this name and value:

  • Name: X-CSRF-Token
  • Value: [paste-the-token-value-here]

Now when you make requests, the token will be passed along correctly with FireFox Poster.

Here's a detailed blog post outlining this topic:

http://tylerfrankenstein.com/code/drupal-services-csrf-token-firefox-poster

这篇关于Drupal 中的 CSRF 验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆