我正试图建立一个“ o2”提供者,利用一项已经过时和设计的申请。 使用者:
class User < ActiveRecord::Base
has_many :authentications
has_many :graphs
devise :database_authenticatable,
:registerable,
:recoverable,
:rememberable,
:trackable,
:validatable,
:omniauthable,
:token_authenticatable,
:oauth2_providable,
:oauth2_password_grantable,
:oauth2_refresh_token_grantable,
:oauth2_authorization_code_grantable
.......
}
其他一切都按预期执行,但当我在当地管理时,我正发现以下错误,并试图利用 o2gem(0.5.0)与我的客户联系。
我最后说:
提出例外:
e.to_yaml
"--- !ruby/exception:OAuth2::Error
response: &70266332040280 !ruby/object:OAuth2::Response
response: &70266332040340 !ruby/object:Faraday::Response
env:
:method: :post
:body: ! {"error":"invalid_grant","error_description":"invalid authorization
code request"}
:url: !ruby/object:Addressable::URI
validation_deferred: false
scheme: http
normalized_scheme: !!null
uri_string: !!null
hash: !!null
host: localhost
authority: !!null
normalized_host: !!null
port: 3000
normalized_port: !!null
path: /oauth2/token
normalized_path: !!null
query: !!null
normalized_query: !!null
:request_headers:
Content-Type: application/x-www-form-urlencoded
:parallel_manager: !!null
:request:
:proxy: !!null
:ssl: {}
:status: 400
:response_headers:
content-type: application/json
x-ua-compatible: IE=Edge
cache-control: no-cache
x-runtime: 0.119701
content-length: 82
server: WEBrick/1.3.1 (Ruby/1.9.2/2011-02-18)
date: Wed, 05 Oct 2011 14:40:10 GMT
connection: close
:response: *70266332040340
on_complete_callbacks: []
options:
:parse: !!null
error: !ruby/exception:OAuth2::Error
response: *70266332040280
code: invalid_grant
description: invalid authorization code request
parsed:
error: invalid_grant
error_description: invalid authorization code request
code: invalid_grant
description: invalid authorization code request
"
我也要指出,没有国家,在最近的草案(http://tools.ietf.org/html/draft-ietf-oauth-v2-22)中,要求国家退席。 这个问题吗?
关于产出,我没有发现服务器产出中的任何明显错误:
rel=“nofollow”>http://pastie.org/2644028
现在还有一点值得注意:我看到几次选举考试,但我从未看到任何数据被插入到各种表格中,特别是不批准在放弃这一例外之前出现的编码。