Doorkeeper separate resource server from the authorization server

房东的猫 提交于 2019-12-07 10:13:14

问题


I am building an ouath 2.0 system in ruby on rails using Doorkeeper. My resource server is protected with doorkeeper_for method and is separate from the authorization server, and i am using the implicit grant flow. So i get the access token from the auth server and then make a request to the resource server in this way: localhsot:3000/pages?access_token=XXXX but when the resource server read the access token it try to looks for the token in its own database and not in the authentication server database so i get a 401 Unautorized error. How can i solve this?


回答1:


You should add a database connection to the authorization server, and in a MyApp::Application.config.to_prepare block instruct the relevant doorkeeper models to connect via those credentials.

See https://github.com/applicake/doorkeeper/issues/266#issuecomment-26800252.



来源:https://stackoverflow.com/questions/18383715/doorkeeper-separate-resource-server-from-the-authorization-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!