真实性令牌 [英] Authenticity Token
问题描述
大家好!我遇到了带有真实性令牌的问题.我的任务是以编程方式登录 http://www.greystripe.com ,然后检索一些信息.发送登录请求的参数为:
authenticity_token:/bHuPcrEK3noThK07d0JyZfCbPrytxjJeeBA3tEgDrDw =
提交:登录
电子邮件:blablabla@bla.com
密码:blabla
我的问题是在哪里获得正确的认证令牌?早些时候,我使用了在Firebug中获得一次的常量值.可能有人已经解决了这个问题.请给我一些建议.谢谢建议.
Hi everyone! I came across the problem with an authenticity token. My task is to log in programmatically at http://www.greystripe.com and then retrieve some information. Post parameters to send login request are:
authenticity_token: /bHuPcrEK3noThK07d0JyZfCbPrytxjJeBA3tEgDrDw=
commit: Login
email: blablabla@bla.com
password: blabla
My question is WHERE to get correct AUTHENTICITY TOKEN? Earlier I used constant value I got once in Firebug. May be somebody have already solved this issue. Give me some advice, please. Thanks in advice.
推荐答案
我发现登录前在页面上有一些信息.我用此令牌挖出了一个隐藏字段.因此,针对我的问题的解决方案是:
1.在POST之前从隐藏字段中获取雅典娜标志.
2.填写POST参数,包括雅典娜令牌.
I found out there is some information at page before logging in. I digged out a hidden field with this TOKEN. So, solution for my issue is:
1. Get athenticity token before POST from hidden field.
2. Fill in POST parameters including athenticity token.
这篇关于真实性令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!