Set full_host property in Omniauth config. In case you're running your app on a different port behind a proxy like Varnish, this ensures the authentication callback returns to  and not to the other port.