title: How to successfully use validate_token in the devise_token_auth gem?
body: <p>I am fairly new to Ruby and Rails itself and I'm trying to build a simple Rails API.</p>
  
  <p>I want to authenticate users via token and I am therefore using the devise_token_auth gem.</p>
  
  <p>I can successfully make a POST request at /auth/sign_in and I am now trying to make a GET request at /auth/validate_token</p>
  
  <p>What I have, as a "test":</p>
  
  <pre><code>    uri = URI.parse("http://localhost:3000/auth/sign_in")
      response = Net::HTTP.post_form(uri, {"email" =&gt; params[:session][:email], "password" =&gt; params[:session][:password]})
  
      uri2 = URI.parse("http://localhost:3000/auth/validate_token")
      params = { :auth_token =&gt; response['access-token'], :uid =&gt; response['uid'], :client =&gt; response['client'] }
      uri2.query = URI.encode_www_form(params)
      response2 = Net::HTTP.get_response(uri2)
  </code></pre>
  
  <p>I am therefore using the access-token and uid retrieved from the response header but I keep getting a 401 response code from /auth/validate_token:</p>
  
  <pre><code> Started GET "/auth/validate_token?auth_token=EEV40VDHfOaWtBzv3bn_DQ&amp;uid=username%40example.com&amp;client=NAzWNJalYBJLRni9dCGxXA" for ::1 at 2016-06-22 15:22:35 +0100
   Processing by DeviseTokenAuth::TokenValidationsController#validate_token as */*
     Parameters: {"auth_token"=&gt;"EEV40VDHfOaWtBzv3bn_DQ", "uid"=&gt;"username@example.com", "client"=&gt;"NAzWNJalYBJLRni9dCGxXA"}
   Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
  </code></pre>
  
  <p>What am I doing wrong? How can I solve this?</p>