Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass extra parameters? #189

Closed
chamnap opened this issue Mar 24, 2015 · 2 comments
Closed

How to pass extra parameters? #189

chamnap opened this issue Mar 24, 2015 · 2 comments

Comments

@chamnap
Copy link

chamnap commented Mar 24, 2015

I'm digging and trying to find solutions for several hours, but i got no luck. I hope I can have answer here.

I checked the gem 'omniauth', we can pass extra parameters like this:
/auth/facebook?listing_id=kh35887

And inside the callback phase, we can retrieve this parameter by calling #params or request.env['omniauth.params'], https://github.com/intridea/omniauth/blob/fc304abe2b56cb6efeff87efdc50d120f4d8e1c0/lib/omniauth/strategy.rb#L225.

/auth/facebook/callback?listing_id=kh35887

I tried this with the gem omniauth-twitter, and it works as expected. However, omniauth-facebook doesn't work with this extra parameters.

@chamnap
Copy link
Author

chamnap commented Mar 25, 2015

After debugging, it turns out that it's the not the fault of omniauth-facebook. It's because omniauth-oauth2 overrides #callback_url so it loses the querystring.

omniauth/omniauth-oauth2#28

@chamnap chamnap closed this as completed Mar 25, 2015
@nratter
Copy link

nratter commented Aug 22, 2018

request.env['omniauth.params'] is working for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants