title: Integrating Doorkeeper and Sorcery
body: <p>I am having trouble with setting up doorkeeper to authenticate using Sorcery..</p>
  
  <p>Sorcery provides a login method via the controller but it doesn't work to use it in the Doorkeeper.rb file.</p>
  
  <p><strong>Doorkeeper.rb</strong></p>
  
  <pre><code>Doorkeeper.configure do
    ...
    resource_owner_from_credentials do |routes|
      login(params[:username], params[:password])
    end
  </code></pre>
  
  <p>Gives this result:</p>
  
  <pre><code>NoMethodError (undefined method `login' for #&lt;Doorkeeper::TokensController:0x0000000209ee38&gt;):
  </code></pre>
  
  <p>How can I do this?</p>