ruby-on-rails – 从门卫处获取“授权服务器不支持此响应类型”
发布时间:2020-12-17 02:23:49 所属栏目:百科 来源:网络整理
导读:我正在尝试使用设计(3.4.1)门卫(2.4.1)Rails 4.2构建一个api,当我尝试连接我的前端应用程序时,我不断收到错误“授权服务器不支持此响应类型”是来自控制台的转储: Started GET "/oauth/authorize?response_type=tokenclient_id=a91f8fea40322739310b0db9ee3
我正在尝试使用设计(3.4.1)门卫(2.4.1)Rails 4.2构建一个api,当我尝试连接我的前端应用程序时,我不断收到错误“授权服务器不支持此响应类型”是来自控制台的转储:
Started GET "/oauth/authorize?response_type=token&client_id=a91f8fea40322739310b0db9ee3e3d53878bff0df073f3aa36af7da4f99b365e&redirect_uri=http%3A%2F%2Flocalhost%3A9000&scope=public&state=" for ::1 at 2015-03-28 16:12:18 -0700 ActiveRecord::SchemaMigration Load (0.9ms) SELECT "schema_migrations".* FROM "schema_migrations" Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"response_type"=>"token","client_id"=>"a91f8fea40322739310b0db9ee3e3d53878bff0df073f3aa36af7da4f99b365e","redirect_uri"=>"http://localhost:9000","scope"=>"public","state"=>""} User Load (3.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id",2]] Doorkeeper::Application Load (1.1ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT 1 [["uid","a91f8fea40322739310b0db9ee3e3d53878bff0df073f3aa36af7da4f99b365e"]] Rendered /Users/osuthorpe/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/doorkeeper-2.1.4/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (287.7ms) Completed 200 OK in 460ms (Views: 406.2ms | ActiveRecord: 11.4ms | Solr: 0.0ms) 前端应用程序工作正常,我可以使用其他oauth2提供程序进行身份验证. 解决方法
我认为新版本的门卫可能会禁用一些grant_flows. 您可以通过在config / initializers / doorkeeper.rb中的grant_flows%w(authorization_code implicit password client_credentials)中删除注释来启用它,以启用所有授权流程
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Freemaker Replace函数的正则表达式运用
- 微信jssdk分享功能开发及解决ajax跨域的问题
- 如何使用flash actionscript 2更改文本颜色?
- Thor会在Ruby命令行应用程序中抱怨拼写错误的选项吗?
- 使用elementUI的时候,使用Upload 上传的时候,使用 list-t
- ruby-on-rails – 如何按年分组?
- postgresql – Vapor Framework:使用SSL配置postgres连接
- 如何返回AJAX响应文本?
- ruby-on-rails – 如何在Ruby on Rails中为模型添加虚拟属性
- 深入浅析JSON.parse()、JSON.stringify()和eval()的作用详解