waterlink / rack-reverse-proxy

A Reverse Proxy for Rack
MIT License
196 stars 52 forks source link

how can i use devise authentication ? #34

Open scrol opened 8 years ago

scrol commented 8 years ago

how to authenticate if the current user is logged in, and then allow the requests to be forwarded to the proxy server?

waterlink commented 8 years ago

@scrol could you tell me at which application do you have devise set up? (at the same, that has rack-reverse-proxy or the app that you are proxying to)?

jxc876 commented 8 years ago

I need something similar, I want to reverse proxy to an API that requires authentication (via a header). I don't know how to pass the header along. Ideally something like :

reverse_proxy '/api', 'www.internal-api.com/api' do |req| 
       req.headers: {  'X-My-Custom-Auth-Header': 'token-12345' } 
end