If you happen to have this page cached here, you may wish to remove the cache.
Or just type localhost:3343/index.html, and
then you will immediately notice that in this index.html,
you will see this button called Log In button.
So we're going to click on this login button to login to Facebook.
Let's log in and then you will come up with this message here.
Which if you have already logged in to Facebook earlier,
it'll ask for the permission to continue as the user.
If not, then it'll ask you to log in to Facebook with and
then allow you to continue.
Since I had just logged in to Facebook a little bit earlier, so
I can just click on Continue.
Now, open the developers JavaScript console at the bottom here.
And in the JavaScript console, you see a bunch of messages printed in here.
And then in particular,
open this object that you will see in the JavaScript console.
And inside this object, you will see this alt response here.
And in there, you will see an access tool present there.
Now, this is a reply that is obtained from Facebook or
out to authentication server by our application here.
And I'm going to simply copy this,
because this is the access token that Facebook has supplied to us.
Now, I need to give this access token to my express server in order for
it to go and verify my profile, and then allow me to log in to that application.
So I am doing this in a clenched way
here simply because I wanted to show you how the access token comes in here.
And we copy the access token, then I'm going to take this and
use Postman to send this access token to my Express server.
Now, when you design a web app like Angular, or
the Ionic app, or the NativeScript app, you don't need to do all these steps.
Now, basically when the access token is returned to your web app,
the Angular app, or the Ionic app, or the NativeScript app,
you'll simply capture this access token in there.
And then you will pass this access token on to the Express
server using the XMLHttpRequest to obtain the information.
But since I wanted to manually illustrate the steps.
So, I set up this index.html with a simple JavaScript
code that Facebook provides for me.