Omniauth branch 0-3-stable of git://github.com/intridea/omniauth.git
Rails 3.0.7
When Omniauth redirects a user to the Facebook auth dialog by making a GET call to “/auth/facebook”, if that user clicks “Cancel” from the auth dialog, then we can the callback request
GET "/auth/facebook/callback?error_reason=user_denied&error=access_denied&error_description=The+user+denied+your+request."
which Omniauth immediately appears to redirect to:
GET "/auth/failure?message=invalid_credentials"
Unfortunately, when this is a response to an app. invitation generated by the FB request dialog, there is no identifying information on which user has “Canceled” out of the auth dialog. If we could send along some identifying information with the Omniauth request, we could allow ourselves to “remember” which user did the “Canceling” which would help us track explicit denials on the back end.
Is there any way to send along data with the call to “/auth/facebook” that would simply get repeated back to us in the resulting call to “/auth/facebook/callback”? This would be similar to the “data” parameter in the requests dialog documentation.
Thanks,
Wes
You can pass through a ‘state’ param which will be passed along to the callback url.
eg. you’d make a call to ‘/auth/facebook?state=SOME_INFO’
Then in the controller action that you route ‘/auth/facebook/callback’ to, you retrieve just as you would a normal param:
info = params[:state]
The param must be named ‘state’. This is mentioned in the omniauth-facebook documentation under the section ‘Per-Request Options’.
https://github.com/mkdynamic/omniauth-facebook