门卫 - 按错误授权结果auth = nil

时间:2013-03-23 17:06:07

标签: ruby-on-rails oauth oauth-2.0 omniauth doorkeeper

当点击“授权”按钮时,我得到“被叫id为nil”

以下是我的授权控制器中出现问题的行:

 46             auth = authorization.authorize 

Auth在错误页面上显示为零:

Local Variables
auth    nil

以下是我的请求参数:

{"utf8"=>"✓", "authenticity_token"=>"0m07v0jefxjeMOMt7U5rjRMJj0qhA27nBsamwKvHSMw=",
"client_id"=>"159c4b355fdef4a8e2887734f2f95af42d6b1199ddf94bb8a0fffb10bd3de0c4",
"redirect_uri"=>"http://localhost:3001/users/auth/provider/callback",
"state"=>"3b654057f568f5f542bfea92f07c9403fcfdc80a7a3208e4", "response_type"=>"code",
"scope"=>"public_read", "commit"=>"Authorize", "action"=>"create",
"controller"=>"oauth/authorizations"}

此外,以下是查看授权/拒绝表单时@pre_auth变量包含的内容:

#<Doorkeeper::OAuth::PreAuthorization:0x007fc83c8d7a28 @server=
<Doorkeeper::Config:0x007fc83c0a3640 @orm=:active_record, @authenticate_resource_owner=
<Proc:0x007fc83c0a34d8@/Users/austen/sites/provider/config/initializers/doorkeeper.rb:7>,
@access_token_expires_in=nil, @enable_application_owner=true,
@confirm_application_owner=true, @default_scopes=public_read,
@optional_scopes=public_write private_read private_write, @scopes=public_read public_write
private_read private_write>, @client=#<Doorkeeper::OAuth::Client:0x007fc83c8d7a78
@application=#<Doorkeeper::Application id: 1, name: "WhiteDeals", uid:
"159c4b355fdef4a8e2887734f2f95af42d6b1199ddf94bb8a0f...", secret:
"d21e16cc50873d60a3f3aacf421c84766e9c183ea7d989f70e6...", redirect_uri:
"http://localhost:3001/users/auth/provider/callback", created_at: "2013-03-22 02:15:55",
updated_at: "2013-03-23 06:33:29", owner_id: 1, owner_type: "User">>,
@response_type="code", @redirect_uri="http://localhost:3001/users/auth/servant/callback",
@scope=nil, @state="3b654057f568f5f542bfea92f07c9403fcfdc80a7a3208e4", @error=nil>

0 个答案:

没有答案