13

I am using Omniauth and forcing /auth/facebook to display in a popup (with JS). [Instead of a new window - which is much less user friendly]

The problem is: Omniauth loads the FB url with

display=page

Instead of what I want:

display=popup

Anyone knows how I can change the params Omniauth uses for facebook ?

Thanks

Boris
  • 3,163
  • 5
  • 37
  • 46

4 Answers4

16

At where you set your Facebook ID and secret key, add one more extra option as:

:display => "popup"
siong1987
  • 1,043
  • 8
  • 12
3

Actually, in the current version of omniauth-facebook, this is what works for me:

:authorize_params => { :display => 'popup' }
courtsimas
  • 764
  • 1
  • 13
  • 20
  • Here is [a relevant github issue for the omniauth-facebook project](https://github.com/mkdynamic/omniauth-facebook/issues/5). I'm not sure why it's closed because the `:authorize_params` for is undocumented. I've asked to have it reopened. – Adam Spiers Jan 13 '12 at 22:28
3

If you're using heroku, then use this option:

config.omniauth :facebook, ENV['FB_APP_ID'], ENV['FB_APP_SECRET'], {:scope => 'email, offline_access', :client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}, :display => 'popup' }
Scott Bartell
  • 2,801
  • 3
  • 24
  • 36
kravc
  • 583
  • 5
  • 15
1

If you're using this with Devise, simply edit your development.rb (and production.rb) to the following;

config.omniauth :facebook, FACEBOOK_API, FACEBOOK_SECRET, :display => 'popup'

Make sure you restart your rails server upon editing these files.

James
  • 2,284
  • 1
  • 20
  • 29