04 Nov 2009, 20:03
Generic-user-small

William Hertling (23 posts)

Hi,

Within the last day or so, our app has suddenly broke. We haven’t pushed any code changes, so I’m curious if Facebook has pushed any changes that would have broken things?

The behavior I see is that when we call ensure_authenticated_to_facebook, it repeatedly redirects. In other words, when it hits ensure_authenticated_to_facebook, it always takes the create_new_facebook_session_and_redirect! path.

def ensure_authenticated_to_facebook
  set_facebook_session || create_new_facebook_session_and_redirect!
end

Any ideas what could be wrong?

I’m not sure the right way to find out what version of the facebooker I have.

According to what’s in facebooker.gemspec, I have: s.version = “1.0.48”
According to what’s in the changelog:

=== HEAD

  • New Features
    • Facebooker::User#publish_to for publishing to a Wall or News Stream
    • Optionally parses with Nokogiri. Just require ‘nokogiri’ in your app.

=== 1.0.13 / 2009-02-26
...

05 Nov 2009, 12:33
Head_pragsmall

Mike Mangino (543 posts)

That’s pretty fundamental code. I don’t believe any of it has changed. Can you send the params that you are receiving? Are you sure your facebooker.yml file hasn’t changed?

28 Jan 2010, 10:48
Avatar_pragsmall

Ivan Kuznetsov (3 posts)

I observe interesting behaviour with ensure_authenticated_to_facebook and FB connect:

If I have in the controller that is responsible for welcoming FB-connect users and mapping the to internal accounts

before_filter :ensure_authenticated_to_facebook

then it crashes when users go directly to this controller (Facebooker::Session::MissingOrInvalidParameter “Invalid parameter”). What happens is user goes to http://foo.com/fb_connect_controller/method and if there’s no FB session, then FB authentication form is opened not as IFRAME.

If logging in using FB-connect happens like this:

then same controller works fine, and FB authentication form appears in IFRAME.

Replacing before filter with:

before_filter :ensure_authenticated_to_facebook_once def ensure_authenticated_to_facebook_once unless facebook_session ensure_authenticated_to_facebook end end

solves that problem, but I’m not sure this is the right way to do it.

28 Jan 2010, 14:42
Head_pragsmall

Mike Mangino (543 posts)

you shouldn’t use ensure_authenticated_to_facebook for facebook connect. That’s a canvas app only setting. You actually want to use create_facebook_session and then check the facebook_session variable. I have an fb_connect_example app on github that shows this.

29 Dec 2010, 00:15
Generic-user-small

daniel (2 posts)

Same problem using canvas with iframe. ensure_authenticated_to_facebook runs properly for show the fb request for permission for user app acceptance, but when try to obtain the facebook_session, obtain the error:
facebook.auth.getSession (0) Facebooker::Session::MissingOrInvalidParameter: Invalid parameter: generate_session_secret = 0, auth_token = 3284906a9c166aa6e723e14d07453edf

a lot of time try and try … without solution

  You must be logged in to comment