Ruby on rails Rails 3.1中门卫的布线问题

Ruby on rails Rails 3.1中门卫的布线问题,ruby-on-rails,oauth,doorkeeper,Ruby On Rails,Oauth,Doorkeeper,我试图使用doorkeeper()来设置一个简单的OAuth提供者,但是在重命名路由时遇到了严重的问题 我正在尝试将我的基本门卫路线设置为“/oauth2/v1”,而不是预先滚动的“/oauth”路线 阅读wiki()我似乎只需要修改 Rails.application.routes.draw do use_doorkeeper end 到 或者名称空间使用_doorkeeper作为“oauth2”,然后提供“v1”的作用域。不幸的是,什么都不管用。我根本不能让门卫使用任何其他的示波器 w

我试图使用doorkeeper()来设置一个简单的OAuth提供者,但是在重命名路由时遇到了严重的问题

我正在尝试将我的基本门卫路线设置为“/oauth2/v1”,而不是预先滚动的“/oauth”路线

阅读wiki()我似乎只需要修改

Rails.application.routes.draw do
  use_doorkeeper
end

或者名称空间使用_doorkeeper作为“oauth2”,然后提供“v1”的作用域。不幸的是,什么都不管用。我根本不能让门卫使用任何其他的示波器

wiki本身似乎已经过时了,因为Rails不再在routes.rb中使用这种构造,所以我实际上试图更改的代码看起来更像这样:

DoorkeeperProvider::Application.routes.draw do
  scope 'oauth2' do
    use_doorkeeper :scope => 'v1'
  end
  ...
end
但是,似乎没有什么能够改变范围

这是rake路由的输出:

      oauth_authorization GET    /oauth2/oauth/authorize(.:format)                   {:action=>"new", :controller=>"doorkeeper/authorizations"}
      oauth_authorization POST   /oauth2/oauth/authorize(.:format)                   {:action=>"create", :controller=>"doorkeeper/authorizations"}
      oauth_authorization DELETE /oauth2/oauth/authorize(.:format)                   {:action=>"destroy", :controller=>"doorkeeper/authorizations"}
              oauth_token POST   /oauth2/oauth/token(.:format)                       {:action=>"create", :controller=>"doorkeeper/tokens"}
       oauth_applications GET    /oauth2/oauth/applications(.:format)                {:action=>"index", :controller=>"doorkeeper/applications"}
                          POST   /oauth2/oauth/applications(.:format)                {:action=>"create", :controller=>"doorkeeper/applications"}
    new_oauth_application GET    /oauth2/oauth/applications/new(.:format)            {:action=>"new", :controller=>"doorkeeper/applications"}
       edit_oauth_application GET    /oauth2/oauth/applications/:id/edit(.:format)       {:action=>"edit", :controller=>"doorkeeper/applications"}
        oauth_application GET    /oauth2/oauth/applications/:id(.:format)            {:action=>"show", :controller=>"doorkeeper/applications"}
                          PUT    /oauth2/oauth/applications/:id(.:format)            {:action=>"update", :controller=>"doorkeeper/applications"}
                          DELETE /oauth2/oauth/applications/:id(.:format)            {:action=>"destroy", :controller=>"doorkeeper/applications"}
oauth_authorized_applications GET    /oauth2/oauth/authorized_applications(.:format)     {:action=>"index", :controller=>"doorkeeper/authorized_applications"}
 oauth_authorized_application DELETE /oauth2/oauth/authorized_applications/:id(.:format) {:action=>"destroy", :controller=>"doorkeeper/authorized_applications"}
         oauth_token_info GET    /oauth2/oauth/token/info(.:format)                  {:action=>"show", :controller=>"doorkeeper/token_info"}
看起来似乎只是忽略了要使用的:scope参数


对于这一点的任何提示都将不胜感激。

因此,您似乎遇到了一个最近修复的问题。请参见此处的提交-

你正在运行哪个版本?理论上,这应该在0.7.3中固定


我会尝试使用Github上Applike/doorkeeper的门卫主分支。这应该可以解决这个问题。

您能提供rake路由的输出吗?理论上,你的最后一个选择应该是可行的,“use_doorkeeper”所做的就是生成一个包装的作用域,配置值为:scope或“oauth”。我已经在问题中添加了“rake routes”输出,因为它太大了,无法放入注释。你完全正确。我已经安装了doorkeeper提供商应用程序,它被固定到doorkeeper的0.5.0版本。谢谢你的帮助!
      oauth_authorization GET    /oauth2/oauth/authorize(.:format)                   {:action=>"new", :controller=>"doorkeeper/authorizations"}
      oauth_authorization POST   /oauth2/oauth/authorize(.:format)                   {:action=>"create", :controller=>"doorkeeper/authorizations"}
      oauth_authorization DELETE /oauth2/oauth/authorize(.:format)                   {:action=>"destroy", :controller=>"doorkeeper/authorizations"}
              oauth_token POST   /oauth2/oauth/token(.:format)                       {:action=>"create", :controller=>"doorkeeper/tokens"}
       oauth_applications GET    /oauth2/oauth/applications(.:format)                {:action=>"index", :controller=>"doorkeeper/applications"}
                          POST   /oauth2/oauth/applications(.:format)                {:action=>"create", :controller=>"doorkeeper/applications"}
    new_oauth_application GET    /oauth2/oauth/applications/new(.:format)            {:action=>"new", :controller=>"doorkeeper/applications"}
       edit_oauth_application GET    /oauth2/oauth/applications/:id/edit(.:format)       {:action=>"edit", :controller=>"doorkeeper/applications"}
        oauth_application GET    /oauth2/oauth/applications/:id(.:format)            {:action=>"show", :controller=>"doorkeeper/applications"}
                          PUT    /oauth2/oauth/applications/:id(.:format)            {:action=>"update", :controller=>"doorkeeper/applications"}
                          DELETE /oauth2/oauth/applications/:id(.:format)            {:action=>"destroy", :controller=>"doorkeeper/applications"}
oauth_authorized_applications GET    /oauth2/oauth/authorized_applications(.:format)     {:action=>"index", :controller=>"doorkeeper/authorized_applications"}
 oauth_authorized_application DELETE /oauth2/oauth/authorized_applications/:id(.:format) {:action=>"destroy", :controller=>"doorkeeper/authorized_applications"}
         oauth_token_info GET    /oauth2/oauth/token/info(.:format)                  {:action=>"show", :controller=>"doorkeeper/token_info"}