Changing callback URI of omniauth in rails

天涯浪子 提交于 2019-12-14 03:57:26

问题


I'd like to use Omniauth 2 gem to authenticate users, but my problem is the callback uri contains the nginx used port 8082, which is hidden to outside. That's why the auth provider would like to redirect the user to hostname:8082, which is dropped.

I tried to rewrite http header, change X-Forwarded-Port, Host, Server-Port attributes (I checked my request object in Rails, and the Server-Port contained the 8082 port number only), but no success. I don't want to modify my application's code, I want to solve it at the webserver's layer.

Do you know any solution to Rails believe his port is 80 when passing the redirect url?

Thanks!

来源:https://stackoverflow.com/questions/5206616/changing-callback-uri-of-omniauth-in-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!