我在我的ruby on rails应用程序中使用了doorkeeper来实现OAuth功能,同时我还使用device来实现用户安全管理。
下面是我当前的看门人.rb文件:
Doorkeeper.configure do
orm :active_record
resource_owner_authenticator do
user_signed_in? || redirect_to(new_user_session_url)
end
admin_authenticator do
user_signed_in? || redirect_to(new_user_session_url)
end
enable_application_owner :confirmation => true
# authorization_code_expires_in 10.minutes
# access_token_expires_in 2.hours
# use_refresh_token
# default_scopes :public
# optional_scopes :write, :update
# client_credentials :from_basic, :from_params
# access_token_methods :from_bearer_authorization, :from_access_token_param, :from_bearer_param
# test_redirect_uri 'urn:ietf:wg:oauth:2.0:oob'
# skip_authorization do |resource_owner, client|
# client.superapp? or resource_owner.admin?
# end
# realm "Doorkeeper"
end
当我访问/oauth/applications时,我得到一个错误页面,上面写着“未初始化的常量Admin”,以及“config/initializers/doorkeeper.rb:18:in 'block(2层)in '"。
我做错了什么?
1条答案
按热度按时间eh57zj3b1#
我已经解决了这个问题。问题在于Rails服务器缓存了doorkeeper.rb初始化程序文件,我需要在编辑完该文件后重新启动服务器。