Updates to Facebook Javascript SDK for OAuth 2.0
If you’ve recently realized that maybe your current Facebook application is no longer working I have a few areas of your code to check. Like me if you failed to realize that December 13th, 2011 was the deadline for Facebook supporting OAuth 1.0 in it’s Javascript SDK then the following are likely the root causes:
- “perms” is now to be referred to as “scope” when asking for permissions from a user
- “session” is now to be referred to as “authResponse”
- “access_token” is now to referred to as “accessToken”
And the examples:
The Old:
FB.login(function(response) { if (response.session) { console.log("User is connected to the application.”); var accessToken = response.session.access_token; } });
And the New:
FB.login(function(response) { if (response.authResponse) { console.log("User is connected to the application.”); var accessToken = response.authResponse.accessToken; } });