After long time on research for the solution to my problem, I am still unable to get the solution. Facebook token comes from the Unity Facebook SDK.
This is on my index.js
passport.use(new FacebookTokenStrategy({
clientID: FACEBOOK_APP_ID,
clientSecret: FACEBOOK_APP_SECRET
}, function(accessToken, refreshToken, profile, done) {
Account.findOrCreate({facebookId: profile.id}, function (error, user) {
return done(error, user);
});
}
));
This is the api
api.get('/auth/facebook/token/:access_token/endpoint',
passport.authenticate('facebook-token'),
function (req, res) {
console.log(req.user);
// do something with req.user
res.send(req.user? 200 : 401);
}
);
But when I make GET request from Postman with this api, only thing i get is Unauthorized
http://localhost:3005/api/v1/account/auth/facebook/token/{token}/endpoint
How can i make this work? Thanks.
After long time on research for the solution to my problem, I am still unable to get the solution. Facebook token comes from the Unity Facebook SDK.
This is on my index.js
This is the api
But when I make GET request from Postman with this api, only thing i get is
UnauthorizedHow can i make this work? Thanks.