I was looking for a solid example or to be pointed in the right direction of how to simulate testing Passport-Facebook's login process. Completely clueless as where to start.
I'm open to any testing framework.
Best, Austin
I was looking for a solid example or to be pointed in the right direction of how to simulate testing Passport-Facebook's login process. Completely clueless as where to start.
I'm open to any testing framework.
Best, Austin
While Passport documentation provides a crude/basic example for use Passport-Facebook strategy
http://passportjs.org/docs/facebook
You may like to have a look at this tutorial from scoth.io for detailed example, it teaches you how to authenticate via facebook, twitter and google+ using Node.js and respective strategies. You'll have to follow the first two lessons to achieve your goal
https://scotch.io/tutorials/easy-node-authentication-setup-and-local
© 2022 - 2024 — McMap. All rights reserved.
authorization_code
grant type (the one that requires the user to login on the provider's server) cannot be fully tested. If you were using Grant you can override the Facebook'sauthorize_url
andaccess_url
to point to a local server in your tests. These route should return fake access token, that you'll receive in the final callback of your app. No idea how is this possible to achieve with Passport though, I don't use it for OAuth login anymore :) – Edition