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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:07:04+00:00 2026-06-04T05:07:04+00:00

I am trying to get the access_token for a user using the FB API

  • 0

I am trying to get the access_token for a user using the FB API + everyauth module for NodeJS, and then I will make serverside graph API requests using the Facebook_Graph_API module to actually make the requests (which requires an access token).

According to the everyauth page:

Then, from within your views, you will have access to the following
helpers methods attached to the helper, everyauth:

  • everyauth.loggedIn
  • everyauth.user – the User document associated with the session
  • everyauth.facebook – The is equivalent to what is stored at req.session.auth.facebook, so you can do things like …
  • everyauth.facebook.user – returns the user json provided from the OAuth provider.
  • everyauth.facebook.accessToken – returns the access_token provided from the OAuth provider for authorized API calls on behalf of the
    user.
  • And you also get this pattern for other modules – e.g., everyauth.twitter.user, everyauth.github.user, etc.

Within my .jade templates I can make the requests just fine:

- if (everyauth.facebook)
h3 Facebook User Data
p= JSON.stringify(everyauth.facebook.user)
p= 'facebook access token is '+ everyauth.facebook.accessToken

My question is, how can I fetch the access token from the server-side javascript? I noticed that within

app.get('/', function (req, res) {
  res.render('home');
console.log(req.sessionStore.sessions.);
});

the req object does contain the access_token value but the corresponding JSON is very unwieldy to parse and not really practical for dozens of APIs. Is there any way I can simply retrieve the access_token from the server using everyauth?

Hypothetically I could simply use a bit of AJAX and send everyauth.facebook.accessToken back to the server from the client but I feel like this is somewhat impractical.

  • 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-04T05:07:06+00:00Added an answer on June 4, 2026 at 5:07 am

    This section answered your question:

    https://github.com/bnoguchi/everyauth/blob/master/README.md#accessing-the-user

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

Sidebar

Related Questions

I am trying to get user status updates using the graph API. These are
I am trying to get the friends of a test user using facebook graph
I'm trying to get an auth token for a user using OAuth. Everything works
Recently I'm working with Facebook batch requests using PHP. Now, I'm trying to get
I'm trying to implement a Login with Facebook using the Open Graph API. So
i am trying to get access to whitepages using YQL. Unfortunately i don't have
I'm trying to get access to the user agent with Flask, but I either
I am trying to get the access key but I cannot make it work.
im trying to update my news feed on facebook. Im using the new graph
I can make a search query using these tokens here: http://developers.facebook.com/docs/api#search in the links:

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.