This morning I have received this email from Facebook:

Dear Developer,

As part of our continued efforts to migrate all apps to OAuth 2.0, we opted in all apps using the new JavaScript SDK to OAuth 2.0 this afternoon at 11am PT and reverted at 1:30pm because we noticed that your app has not migrated. Please ensure that you have set the oauth param in FB.init to true and that you are using FB.getAuthResponse to obtain the access token.

Read more in the OAuth2 migration announcement, updates to the new JS SDK blog post, or our JS SDK docs.

If your app was affected today, please ensure that you have made these changes by December 13th, 2012 to avoid any disruption with your users.

Thanks,Facebook Developer Relations

So it looks like we should adapt if we don't want Facebook login to stop working soon...

asked 09 Dec '11, 05:24

Oscar's gravatar image

Oscar ♦
2.1k376169
accept rate: 27%


The Facebook authentication module has been modified to support the OAuth 2.0 mechanism better, relying on the server-side flow, as described in the documentation: http://developers.facebook.com/docs/authentication/#server-side-flow

The previous implementation was using the JavaScript SDK, and indeed when I was testing some issues were found after the oauth parameter had been enabled.

Also, from now on the OAuth 2.0 access token is stored in session, rather than in a cookie - which means better security. For the implementation the following modules were used:

  • cgi.parse_qs - to parse a query given as a string argument
  • urllib.urlopen - for communication with the API and to encode a dictionary with arguments into a URL string

SVN commit: http://svn.osqa.net/changelog/OSQA/?cs=1211

Important! In order to have everything working smoothly after December 13th, consider updating.

link

answered 10 Dec '11, 06:37

Jordan's gravatar image

Jordan ♦♦
3.1k618
accept rate: 39%

@Jordan thanks for the update!

(10 Dec '11, 12:05) Oscar ♦

@Jordan My facebook button disappeared from the signin page after I updated.

I updated to 1211 manually. Just copying and pasting the code from svn. Is there a problem updating this way?

(10 Dec '11, 16:30) Michael1

I guess you've missed something during the pastes. Better do a complete update.

(11 Dec '11, 09:48) Jordan ♦♦
1

@Jordan We have updated to trunk and the problem is that now OSQA uses a different ID for Facebook users. This means that all our current Facebook users lose all their configuration, karma, etc. because they are identified as new users.

Until today OSQA used the Facebook user id (a long number) as the identifier and now trunk uses a long alphanumeric token as the id.

Could you please update trunk to use again the Facebook user id ?

(16 Dec '11, 05:43) Oscar ♦

@Jordan the current situation is even worse than I thought because the access_token that you are currently using as assoc_key changes every time that the user logs in through Facebook. So every time she/he is identified as a completely new user.

Could you please use again the Facebook id as the assoc_key ?

(16 Dec '11, 06:13) Oscar ♦
1

Hey @Oscar. I've just reworked the Facebook authentication to use user ID for further association. It was a bit confusing, because other OAuth 2.0 authentication providers use access_token for association, but in any case sorry for the issue and thanks for the catch.

http://svn.osqa.net/changelog/OSQA/?cs=1213

(16 Dec '11, 07:12) Jordan ♦♦

@Jordan thanks! Your last commit fixes the issue completely. :)

(16 Dec '11, 08:18) Oscar ♦

@Jordan, can you please edit your answer, so that it gives links to all the commits and steps required for the update?

(17 Dec '11, 12:15) mgiann

Hey @mgiann, to update just follow the standard update procedure for your installation - if you've checked out OSQA from SVN, then just run "svn update", or just overwrite the existing code, and then restart the Apache2 server. Regarding the commits - all of them are available on this page, you can follow if you need them.

(17 Dec '11, 13:28) Jordan ♦♦
showing 5 of 9 show 4 more comments

OSQA uses OAuth 2.0 for Facebook authentication since revision #1044: http://svn.osqa.net/changelog/OSQA?cs=1044

If you're using version >= 1044 everything should be ok with the Facebook login on your site.

link

answered 09 Dec '11, 09:02

Jordan's gravatar image

Jordan ♦♦
3.1k618
accept rate: 39%

I don't think it is using OAuth because in the call to FB.init() I don't see the parameter "oauth: true".

More info:

https://developers.facebook.com/docs/oauth2-https-migration/

(09 Dec '11, 10:36) Oscar ♦

I don't think that the oauth parameter would be an issue in this case, because after the migration to OAuth 2.0 it should start defaulting to true I guess, but just in case it doesn't I modified it to true: http://svn.osqa.net/changelog/OSQA/?cs=1210

However I'll do some testing with the Facebook authentication later to check that everything is ok.

(09 Dec '11, 10:58) Jordan ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×75
×40
×2

Asked: 09 Dec '11, 05:24

Seen: 821 times

Last updated: 17 Dec '11, 13:28

powered by OSQA