Separate Doorkeeper resource server from authorization server

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

+4
source share
1 answer

You should add a database connection to the authorization server, and in the MyApp::Application.config.to_prepare block specify the appropriate doorkeeper models for connecting through these credentials.

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

0
source

Source: https://habr.com/ru/post/1498408/


All Articles