【发布时间】:2012-06-12 11:07:49
【问题描述】:
目前,devise 配置为通过 URL 接受令牌身份验证,并且 curl 运行良好
curl 'http://localhost/index.json?auth_token=TOKENVALUE'
现在我想通过 HTTP 标头而不是 URL 传递 TOKENVALUE,我如何配置设计以从 either HTTP 标头 或 URL 获取 TOKENVALUE?这样上面和下面的 curl 请求都可以工作:
curl 'http://localhost/index.json' -H 'Authorization: Token token="TOKENVALUE"'
如this railscast所示。
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 devise