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 8051045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:13:12+00:00 2026-06-05T07:13:12+00:00

If I am using the server side flow to authenticate a user and acquire

  • 0

If I am using the server side flow to authenticate a user and acquire an access token, how can I set that access token in the JavaScript SDK and use it to make calls from the client side?

  • 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-06-05T07:13:13+00:00Added an answer on June 5, 2026 at 7:13 am

    Once the user has finished the server side authentication flow the user is already authorized for your app, all you need to do is to use the FB.getLoginStatus method:

    FB.getLoginStatus(function(response) {
        if (response.status === "connected") {
            console.log("authResponse: ", response.authResponse);
            FB.api("me", function(response2) {
                console.log("Hey there " + response2.name);
            });
        }
        else if (response.status === "not_authorized") {
            // user is logged in to facebook but hasn't authorized your app, should not happen if he went through the server side authentication
        }
        else {
            // user is logged out of facebook, also should not happen
        }
    }
    

    As you can see you can simply use the js sdk to query the graph, there’s no need to get the token manually, but in case you still need it, the authResponse should have the following format:

    authResponse: {
        accessToken: "aaaaaaa",
        expiresIn: "bbbbbb",
        signedRequest: "cccccc",
        userID: "dddddd"
    }
    

    Edit

    If the user is logged into facebook and has allowed and interacted with your app then yes the getLoginStatus should return a valid access token.
    There are a few cases in which this is not the case, one of them being that the token has expired.

    As it states in the Handling Invalid and Expired Access Tokens:

    Desktop Web and Mobile Web apps which implement authentication with the Javascript SDK

    Calling FB.getLoginStatus() or ensuring status: true is set when you
    call FB.init() means that the next time a user lands on your
    application and is signed into Facebook, the authResponse object you
    are passed as a result of those calls will contain a fresh, valid
    access token.

    In this case, its simply the act of the user using your application
    which implicitly generates a new access token.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the Server Side flow to get a user's permissions to access
Normally, I can can set the TargetControlID server side using something like this: AutoCompleteExtender
I am handling the authentication using the server side oauth flow. All that is
I currently have a control that is being hidden on my server side using
I'm trying to access user's language preference w/o using server code. I'm looking for
I am using Server Side variable as <%=value01%> and I need the a JavaScript
I'm trying to output a PDF using server side javascript (ASP). The current method
I'm in active development of an ASP.NET web application that is using server side
I am trying to change a label's text by using server-side JavaScript (onclick) and
I know that node.js is said to be event-driven I/O server-side javascript hosted on

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.