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

  • Home
  • SEARCH
  • 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 8038151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:08:22+00:00 2026-06-05T03:08:22+00:00

My friend called this like lambda-calculus, even though I know some lambas — I

  • 0

My friend called this like lambda-calculus, even though I know some lambas — I am still confused how the authorization really works to get the access token.

So please explain this code, hopefully line-by-line. Source of the example is here.

 FB.login(function(response) {
   if (response.authResponse) {
     console.log('Welcome!  Fetching your information.... ');
     FB.api('/me', function(response) {
       console.log('Good to see you, ' + response.name + '.');
     });
   } else {
     console.log('User cancelled login or did not fully authorize.');
   }
 });

P.s. Trying to categorize things here, the q is a sub-problem.

Perhaps related

  1. Explain the Facebook access_token

  2. Facebook get access Token

  • 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-05T03:08:24+00:00Added an answer on June 5, 2026 at 3:08 am
    FB.login(function(response) {
    

    FB is where all of the Facebooks functions live. All the methods are defined here: https://developers.facebook.com/docs/reference/javascript/ . Login in particular will popup a dialog asking the user to sign in or approve your app.

       if (response.authResponse) {
    

    If they approve your app or have it already added, the response.authResponse will be populated. authResponse also has accessToken, expiry, and UserID. See more details here: https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/

         console.log('Welcome!  Fetching your information.... ');
         FB.api('/me', function(response) {
    

    This goes to Facebook to ask for the user who just approved/signed into your app. Now you can get the basic information about the user. All the available fields with permissions you need to get them are available here: https://developers.facebook.com/docs/reference/api/user/

           console.log('Good to see you, ' + response.name + '.');
    

    This is just getting the name from the user object that you recieved from the /me endpoint.

         });
       } else {
         console.log('User cancelled login or did not fully authorize.');
    

    This means the user cancelled or did not approve your app so you cannot grab any of their information from Facebook.

       }
     });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since I started this new webshop for a friend to launch, which still in
I have a simple demo app like this Friend = Backbone.Model.extend name:null Friends =
I have an array called $friend_array. When I print_r($friend_array) it looks like this: Array
I'm trying to overload the comma operator with a non-friend non-member function like this:
Inspired by this question , I'd like to know whether there is any trick
I have a table called 'friends', this contains the columns person1 and person2 .
A friend gave me this code snippet in Clojure (defn sum [coll acc] (if
A good friend recommended this site to me, it looks really useful! I'm a
I have a class with the only constructor like this: IntroScreen::IntroScreen(Game *game) : View(game),
I have a problem to solve like this. there is time interval, and each

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.