- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我无法为在/oauth/applications 中创建的应用程序生成访问 token
我在看门人初始化文件中做了以下更改
doorkeeper.rb
resource_owner_authenticator do
User.find_by_id(session[:user_id]) || redirect_to(new_user_session_url)
end
Started GET "/oauth/authorize?client_id=87122ba040e56b44477a69b189ad809bf663c374f8cc513dd55bff81c07f030b&redirect_uri=http%3A%2F%2Flocalhost%3A3001%2Fauth%2Fapi_provider%2Fcallback&response_type=code&scope=" for 127.0.0.1 at 2017-01-12 12:04:52 +0530
Processing by Doorkeeper::AuthorizationsController#new as HTML
Parameters: {"client_id"=>"87122ba040e56b44477a69b189ad809bf663c374f8cc513dd55bff81c07f030b", "redirect_uri"=>"http://localhost:3001/auth/api_provider/callback", "response_type"=>"code", "scope"=>""}
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT 1
Redirected to http://localhost:3000/users/sign_in
Filter chain halted as :authenticate_resource_owner! rendered or redirected
Completed 302 Found in 2ms (ActiveRecord: 0.3ms)
Started GET "/users/sign_in" for 127.0.0.1 at 2017-01-12 12:04:52 +0530
Processing by Devise::SessionsController#new as HTML
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
Redirected to http://localhost:3000/
Filter chain halted as :require_no_authentication rendered or redirected
Completed 302 Found in 2ms (ActiveRecord: 0.1ms)
Started GET "/" for 127.0.0.1 at 2017-01-12 12:04:52 +0530
Processing by PagesController#index as HTML
Rendered pages/index.html.erb within layouts/application (0.0ms)
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
Rendered layouts/_navbar.html.erb (1.2ms)
Completed 200 OK in 136ms (Views: 135.0ms | ActiveRecord: 0.1ms)
最佳答案
resource_owner_authenticator 应替换为下面的块,以便为您的客户端应用程序生成 auth tockns
resource_owner_authenticator do |routes|
current_user || warden.authenticate!(:scope => :user)
end
关于ruby-on-rails-4 - Devise+activeadmin+doorkeeper - 过滤器链停止为 :require_no_authentication rendered or redirected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41606690/
我正在使用 Doorkeeper 在 ruby on rails 中构建一个 ouath 2.0 系统. 我的资源服务器受 doorkeeper_for 方法保护,与授权服务器分开,我使用的是隐式
假设我有一个已从系统中软删除的用户。我也想撤销他们的 token 。实现这一目标的最佳方法是什么?是否像做类似的事情一样简单 Doorkeeper::AccessToken.where(resourc
我遇到的问题是我正在使用门卫 resource owner credential flow从 iOS 应用程序验证用户。不过,我的项目有两个单独的用户模型(让我们称它们为 User 和 Admin)。
我正在为我的 Rails 应用程序使用 Doorkeeper,并且我正在尝试使当用户从 doorkeeper 提供商注销时,用户将自动从所有应用程序注销。 默认情况下,当用户退出应用程序时,他仍将在看
我找到了一个相关的 question没有满意的答案,所以在这里再次提问: 我正在使用 Doorkeeper我的应用程序的 API 调用的 GEM。我已按照 oauth2 中给出的步骤进行操作 gem
我正在尝试通过 API 在我的应用程序上创建一个用户帐户。在我的 API Controller 的顶部,我向 doorkeeper_for 添加了一个异常(exception),以便创建可以由具有 t
我正在尝试在 Ruby on Rails API 应用程序中使用 Doorkeeper 进行身份验证。我想从客户端 AngularJS 应用程序获取访问 token 。目前,这涉及到/oauth/au
http://localhost:3000/oauth/token { "error": "invalid_client", "error_description": "Client authenti
我在 AngularJS 中有一个前端,在 RoR 中有一个后端,有 Devise + Doorkeeper + RocketPants。 现在我有正常工作的 CORS,我可以成功地从我的 API 获
我目前正在关注此 railscast对于我的具体情况,我在 omniauth 的回调中遇到了法拉第超时错误。 目前我使用 rails 应用程序作为 API 和主干作为 javascript 前端(在同
由于 Doorkeeper 是一个孤立的引擎,我们无法访问您在 ApplicationController 中所做的任何事情.但是如果你需要一个 current_user 怎么办?这里有什么解决方法?
我有以下问题:是否可能?如果可能,集成 OAuth2、Devise 和 Doorkeeper 的最佳方式是什么?当然,我的主要目标是保护我的 API 所在的 RoR 服务器。只有 token ,没有
我是 Rails 和 webdev 的新手。尝试使用 Rails + Devise + Doorkeeper(如在 https://github.com/doorkeeper-gem/doorkeep
这 Doorkeeper protected controllers in RSpec 的等价物是什么在 Minitest 中? let(:token) { double :accessible? =
我正在使用 rspec_api_documentation 在 Rails 4 中构建 API并留下了深刻的印象。选择使用 DoorKeeper 来保护我的端点后,我能够从控制台成功地测试这一切,并使
我在使用 Doorkeeper::TokensController 时遇到问题。 我想在请求访问 token 之前使用 before_action (默认路由是 POST/oauth/token/Do
我正在尝试修改 Doorkeeper gem 附带的 View (引用 wiki:https://github.com/doorkeeper-gem/doorkeeper/wiki/Customizi
我已经实现了一个 REST API 并使用门卫保护它。我编写了一个小型客户端程序来访问它,并且使用资源所有者凭据流可以正常工作。 现在我正在尝试使用客户端凭据实现调用 flow .所以我遵循了链接中的
我正在尝试为 iOS 应用程序创建一个登录系统,其后端由设备和门卫提供支持。 我想限制网络请求的数量,因此不想从凭据中获取 token ,然后将用户详细信息作为单独的请求获取。 这是我当前的尝试: t
我正在设置 Doorkeeper和 OAuth2对于我的一个 Rails 应用程序。我的目标是根据用户的 access_token 允许 api 访问用户,这样只有用户才能看到他们的“user_sho
我是一名优秀的程序员,十分优秀!