Access the current client application using Doorkeeper

I use Doorkeeper to manage client applications in the Rails-based API that I create. I have a controller action in which I would like to check some information about the client application by sending a request that processes the action.

Does Doorkeeper provide an auxiliary or other easy way to access (in the controller) the Doorkeeper :: Application that handled the request? I foresee an analogue of the Devise method 'current_user'.

If such an assistant does not exist, how can I get this information?

+8
ruby-on-rails-3 doorkeeper
source share
1 answer

And now I get it.

Doorkeeper provides a doorkeeper_token that can be accessed in the controller. This is a Doorkeeper::AccessToken object that references the application to which the token belongs (like doorkeeper_token.application ). This is the link (in the sample code) here .

+10
source share

All Articles