omniauth-ldap icon indicating copy to clipboard operation
omniauth-ldap copied to clipboard

request.env is half-missed in callback_phase

Open Bregor opened this issue 14 years ago • 0 comments

  • Rails-3.1.3 | 3.2.0.rc1
  • Devise-1.5.3
  • Omniauth-LDAP-1.0.2

Is there any way to obtain real remote ip in callback phase?

As far as I dig I get following:

Outside of callback_phase:

request.env["REMOTE_ADDR"] == request.env["action_dispatch.remote_ip"] == 77.75.123.65 (my real client ip)

Inside of callback_phase:

request.env["REMOTE_ADDR"] == request.env["action_dispatch.remote_ip"] == 127.0.0.1

And there is no any proxy variables from NGINX in callback_phase, such as HTTP_X_FORWARDED_FOR and so on.

Code examples:

  • https://gist.github.com/f0b0c2946e4bc94c4a3f#file_omniauth_callbacs_controller.rb
  • https://gist.github.com/f0b0c2946e4bc94c4a3f#file_routes.rb

P.S. with oa-enterprise-0.3 and devise-1.4 request.env was unchanged in callback_phase.

Bregor avatar Dec 26 '11 16:12 Bregor