Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6385461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:54:09+00:00 2026-05-25T02:54:09+00:00

So, we switched from Facebook Connect to the new Javascript SDK and OpenGraph when

  • 0

So, we switched from Facebook Connect to the new Javascript SDK and OpenGraph when it first came out.

Back in May, some of our customers got an email telling them that they might have security holes and might need to upgrade to Oauth 2.0. I looked at our new code compared with the docs for FB.login at the time and ended up with the impression that customers using our new stuff would be OK, so customers on the old Facebook Connect version of our product would have to upgrade to the latest version.

Today it came to my attention that the Javascript SDK was changed so that to use OAuth 2.0, code changes would need to be made after all. (i.e. this blog post, which was made over a month after that email went out), and that I’d need to upgrade by October 1st.

So, today I tried just setting my app’s “Oauth 2.0 Migration” flag to true and running it with our same code. It worked, which I didn’t expect. So my question is, do I need to make code changes outlined in the linked blog post or not? If the app works today with the “Oauth 2.0 Migration” checkbox checked, is that valid cause to assume that it will continue to work after October 1st?

Here’s my code:

// call to FBinit does not include oauth: true
FB.init({appId: opts.ApiKey, status: true, cookie: true, xfbml: true});

// call to login expects response.session on response. not response.authResponse. 
// Shame on Facebook for arbitrarily renaming that so I can't do a clean swap.
FB.login(function(response){
    if(response.session){
        var access_token = response.session.access_token;
        // blah blah blah
    }
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:54:10+00:00Added an answer on May 25, 2026 at 2:54 am

    I would change all the code over, also enabling O-2.0 and using old auth methods could break a session causing users not be able to log out through the application, or leaving session in the app when user logs out of Facebook.


    With new O-2.0 enabled and old auth disabled, i use the sample below, integrated with php-sdk 3.1.1 with out any error or issue.

          <div id="FBauth"></div>
          <div id="fb-root"></div>
    <script>
          window.fbAsyncInit = function() {
            FB.init({
        appId  : '112104298812138',
        status : true, // check login status
        cookie : true, // enable cookies to allow the server to access the session
        xfbml  : true, // parse XFBML
        //channelUrl : 'http://WWW.MYDOMAIN.COM/channel.html', // channel.html file
        oauth  : true // enable OAuth 2.0
            });
    FB.Canvas.EarlyFlush.addResource("http://shawnsspace.com/index.php");
    FB.Canvas.setAutoResize();
                FB.getLoginStatus(function(response) {
                  if (response.authResponse) {
                    // logged in and connected user, someone you know
                    var authbox = document.getElementById('FBauth');
                    //authbox.innerHTML="Hey" +authResponse.name+ "";
                    authbox.innerHTML="<fb:login-button autologoutlink='true'></fb:login-button><fb:login-button show-faces='true' width='250' max-rows='1'></fb:login-button>";
                    FB.XFBML.parse(authbox);
                    //var a = document.createElement('a');
                    //alert();
                  } else {
                    // no user session available, someone you dont know
                    var authbox = document.getElementById('FBauth');
                    authbox.innerHTML="";
                    var a = document.createElement('a');
                    a.setAttribute("href","javascript:void();");
                    a.setAttribute("onclick","FBlogin();");
                    a.innerHTML="Please Login";
                    authbox.appendChild(a);
                    //alert('not logged in'+response+'');
    //
            window.FBlogin = function(){
                    FB.login(function(response) {
                   if (response.authResponse) {
                     FB.api('/me', function(response) {
                     });
    
                   } else {
                   top.location.href = "http://apps.facebook.com/shawnsspace/";
                     // user cancealed login.
                   }
                 }, {scope: 'manage_pages'});
            };
    //          
                  }
                }); 
    
            FB.Event.subscribe('auth.login', function(response) {
            top.location.href = 'http://apps.facebook.com/shawnsspace/';
            });
            FB.Event.subscribe('auth.logout', function(response) {
            //top.location.href = "http://facebook.com/designbyshawn";
            });
          };
          (function() {
            var e = document.createElement('script'); e.async = true;
            e.src = document.location.protocol +
              '//connect.facebook.net/en_US/all.js';
            document.getElementById('fb-root').appendChild(e);
          }());
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I first switched from Java to C#, I was really impressed with C#'s
I have just switched from svn to mercurial and have read some tutorials about
I am just getting started with the Facebook JavaScript SDK, all I want to
I switched from Intelligencia's UrlRewriter to the new web forms routing in ASP.NET 4.0.
Just switched from apache and having some rewrite issues. Simple task: rewrite http://www.foo.com/BAR/ to
I switched from Visual Studio to Code::Blocks yesterday, and just had some strange compiler
We recently switched from TFS2008 to TFS2010, and now one of our build definitions
I've recently switched from being an employee of a small consulting company to being
My company unwittingly switched from cvs to subversion and now we're all wishing we
We just switched from TFS to SVN, and so far we're loving it. However,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.