title: How to get Authorization token in Rails
body: <p>I have the following ApiController that deals with Authorization via a before_action filter:</p>
  
  <pre><code>class ApiController &lt; ApplicationController
    before_action :restrict_access
  
    private
  
    def restrict_access
      authenticate_or_request_with_http_token do |token, options|
        ApiKey.exists?(access_token: token)
      end
    end
  end
  </code></pre>
  
  <p>This works fine.</p>
  
  <p>Now, I have a controller from that Api that needs to use that ApiKey in order to find the associated user. So, I have tried doing this:</p>
  
  <pre><code>class OrdersController &lt; ApiController
    def index
      # How do I access the ApiKey that has been detected in the parent filter?
      @user = ApiKey.find_by(access_token: params[:token]).user # This is not working
    end
  end
  </code></pre>
  
  <p>This doesn't work because params[:token] is empty, because the token is passed in the Authorization header like <code>Authorization Token token='xxxx'</code>. So, how can I get that from my controller?</p>