Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate resource server from the authentication server #266

Closed
apellizzn opened this issue Aug 22, 2013 · 4 comments
Closed

Separate resource server from the authentication server #266

apellizzn opened this issue Aug 22, 2013 · 4 comments

Comments

@apellizzn
Copy link

When i make a request to the resource server like url/resource?access_token=XXX with the access token provided by the authentication server the doorkeeper_for :all in resources_controller search for the access token inside resource server app's oauth table: oauth_access_tokens but i want it to search in the authentication server app's db. How to solve this?

@rafmagana
Copy link

I'm interested on this too, did you find any solution?

@apellizzn
Copy link
Author

I solved this by setting in mongoid.yml or database.yml a session for each server and than adding to config/initializers/doorkeeper.rb:

MyApp::Application.config.to_prepare do
  Doorkeeper::AccessToken.class_eval { store_in collection: :oauth_access_tokens, session: 'authentication' }
  Doorkeeper::AccessGrant.class_eval { store_in collection: :oauth_access_grants, session: 'authentication' }
  Doorkeeper::Application.class_eval { store_in collection: :oauth_applications, session: 'authentication' }
end

@tute
Copy link
Contributor

tute commented Oct 24, 2013

Thank you for your question and your answer, @apellizzGit.

@cickes
Copy link

cickes commented Nov 14, 2016

@apellizzn Can you help with a few more details? Did you connect to the Auth Database or the Auth Server? My understanding is you connected to the Auth Database directly from the Resource Server.

If you connected directly to the Auth server, can you provide your database.yml or mongoid.yml example? Trying to connect to the Auth Server and only allow the Auth Server to access the Auth database. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants