title: Omniauth: env['omniauth.origin'] not available when using OmniAuth.config.full_host
body: <p>I have a situation where my production rails 3.2 app runs on multiple domains.  I am setting up omniauth authentication (version 1.1.0, also using devise 2.1.0 if it matters) to work across these domains.  Unfortunately, many oauth providers (Facebook, for example) only allow integration with one domain at a time, or require you to specify each of the callback URLS you wish to use.  This is not practical for this use case, as domain names are constantly being added.</p>
  
  <p>My solution was to have a single authentication URL, so that when a user tries to log into any of the affiliate sites using omniauth, the callback URL is one single standard url (ie auth.example.com).</p>
  
  <p>I was able to get the omniauth integration working, and I can allow users to authenticate to the auth.example.com domain.  The next step is to send them back to where they came from, along with some sort of authentication key.  I was using <code>env['omniauth.origin']</code> to determine the user's original locations, but for some reason this variable becomes blank any time I've restarted the rails server with the <code>OmniAuth.config.full_host</code> option set.</p>
  
  <p>Long story short: I can access <code>env['omniauth.origin']</code> just fine in my callback controller, as long as I'm not using <code>OmniAuth.config.full_host</code> in my initializer.  However, I can't figure out how to get cross-domain authentication working without it.</p>
  
  <p>EDIT:
  I've created a small sample app to demonstrate the issue.  You will have to fill in your own facebook app credentials in config/initializers/omniauth.rb.  You will notice that when you authenticate with facebook, the params and origin are passed through properly.  However, if you uncomment the full_host configuration option in config/initializers.omniauth.rb and restart the app, you will notice that after you authenticate with Facebook, you are redirected to the proper URL, but the params and origin data are no longer passed through.</p>
  
  <p><a href="https://github.com/dangerp/omniauth_origin_example" rel="nofollow">https://github.com/dangerp/omniauth_origin_example</a></p>