title: How use authorized user to make requests to another project with the same ldap authorization?
body: <p>I can't make request to another project with the same auth</p>
  
  <p>I've tried to make</p>
  
  <pre><code>req.basic_auth curent_user.username, current_user.encrypted_password
  </code></pre>
  
  <p>But it said currnet_user is not defined</p>
  
  <p>I've tried to set in project2</p>
  
  <pre><code>skip_before_filter :authenticate_user!, only: :get_data
  </code></pre>
  
  <p>Bit it returns</p>
  
  <pre><code>{"status":"422","error":"Unprocessable Entity"}
  </code></pre>
  
  <p>The code is</p>
  
  <pre><code>uri = URI(["#{request.protocol}#{request.host_with_port}", 'clients', Rails.configuration.system_client_name, 'project1', 'get_data'].join('/'))
  res = nil
  Net::HTTP.start(uri.host, uri.port,
    :use_ssl =&gt; uri.scheme == 'https'
  ) do |http|
    req = Net::HTTP::Post.new(uri.request_uri)
    # ??? req.basic_auth curent_user.username, current_user.encrypted_password
  
    res = http.request(req)
  end
  data = res.body
  </code></pre>
  
  <p>Project1</p>
  
  <pre><code>def get_data
    render json: {q: 1}, status: 200
  end
  </code></pre>
  
  <p>Gems are the same in both projects</p>
  
  <pre><code>    devise_ldap_authenticatable (0.8.1)
        devise (&gt;= 3.0)
        net-ldap (&gt;= 0.3.1, &lt; 0.6.0)
  </code></pre>