问题标签 [passport-facebook]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
node.js - Phonegap Facebook authentice in server side using expressjs and passportjs
I built a web server using nodejs and expressjs where authentication is done using passportjs. I now want to build a mobile application using phonegap and of course use my existing web server to query for data. I need to authenticate my users using Facebook connect on my server and only then the session is created and I can query my API. I searched a lot for a solution and found nothing. I looked at InAppBrowser and ChildBrowser but I don't think they will do the trick as I need to keep the session alive in order to query the api. Any help would be appreciated
Thanks
facebook - Facebook Graph 返回的值与使用 passport-facebook 保存的值不同
我有一个应用程序,用户使用 facebook 帐户登录,保存 ID、姓名和电子邮件。我正在使用https://github.com/jaredhanson/passport-facebook
问题是我需要获取也在使用该应用程序的 facebook 朋友,但 facebook graph 返回的“id”与我在应用程序中坚持的内容不匹配。
https://graph.facebook.com/me/friends?fields=id,name&access_token=xpto
收到护照-facebook 的“profile.id”与 facebook 图形字段“id”不同
javascript - Facebook 应用程序不提供用户名
我有一个基于 PassportJS 的代码,它使用 Facebook 将我的用户登录到网络应用程序。我在 Facebook 上定义了两个应用程序。当我使用其中一个应用程序时,我会获取有关用户的所有信息(在这种情况下,用户是我),包括用户名、家乡等。但是,当我使用另一个应用程序时(我只更改应用程序 ID 和密码,其余代码相同)某些用户配置文件详细信息不可用。
你知道这里可能是什么问题吗?与应用程序设置有关吗?
facebook - FacebookTokenError:验证客户端密码时出错
当用户尝试通过 facebook 登录时,我收到此错误。我的应用程序使用快递。
这是什么原因造成的?我如何解决它?
node.js - node.js中护照身份验证后如何发送json作为响应
我正在尝试这个git 示例。
当我将它与我的项目集成时效果很好,但我想要实现的是发送json作为对客户端/请求的响应,而不是successRedirect:'/profile'和failureRedirect:'/signup'。
是否可以发送 json,或者是否有其他方法可以得到相同的结果?
任何帮助将不胜感激,TU
node.js - Passport login redirection
I'm using passport-facebook for logging into the site using facebook(the implementation is complete and working good) .Now , I want to redirect the user to a page containing a form which they are supposed to fill once they login from fb, and without doing it (that is without filling the form and submitting it) they shouldnt be able to access any other links on the site.
Here is the approach I thought of: Once the user logs in I would make a Database query inside the strategy to see whether they have previously submitted the data, if they have already submitted I would set the session.filledOrNot = true
in the object which I'll be returning to the done callback and use this property to either allow them to proceed or redirect back the same page.
Is this a good approach?
facebook-graph-api - 使用 Facebook 登录和本地登录的 expressjs 护照
我使用 ExpressJS 的 Passport 中间件,但我找不到同时使用 passport-local 策略和 passport-facebook 策略的方法。我想设置它,以便用户在我的网站上创建一个帐户,然后,如果他们愿意,他们可以登录 facebook,这样你就可以看到你的朋友也在使用该网站。但是,当返回 facebook api 数据时,我不知道登录用户是什么。
当有人创建帐户时,他们的数据(用户名、电子邮件等)存储在数据库中。当他们随后登录 facebook 时,我只想更新数据库和会话,以现在包含 Facebook API 返回的一些信息(facebookID、AccessToken 等)。如何做到这一点?
这是我可以用来访问返回的 facebook 数据的代码。仅当数据库条目之前已经与 facebook 同步时,User.findOne 行才有效。有什么方法可以传递 req.session 数据来识别当前登录的用户是什么并更新他们的个人资料?
node.js - PassportJS 和 Facebook Opengraph api 版本 2.0 错误
我最近才开始使用护照库,完全是菜鸟。但是,当我使用我新创建的 facebook 应用程序登录时,我收到以下错误:
500 FacebookGraphAPIError: (#12) 用户名已弃用 v2.0 及更高版本
一些研究表明,facebook 的开放图形 api 不再支持“用户名”字段。但是,护照库似乎不支持第 2 版。
javascript - 为什么对每个请求都执行 passport.serializeUser?
我正在使用 passport.js + passport-facebook-token 来保护我使用 Strongloop 的 Loopback Framework 构建的 API。
为什么passport反序列化成功后又对反序列化的用户进行序列化?每个请求都会调用 passport.authenticate 方法!我究竟做错了什么?
这是节点的日志:
这是js代码:
node.js - req.session.passport 和 req.user 空白,并且 req.isAuthenticated 在使用 passport-facebook 初始成功登录后返回 false
在从 Facebook 初始成功登录并使用 passport-facebook 1.0.3 和 express 4.6.1 进行登录重定向回调后,req.session.passport 和 req.user 包含在序列化调用期间设置的值(我从策略中获得),但是在随后访问站点上的不同路由时, req.session.passport 和 req.user 为空白,并且 req.isAuthenticated() 返回 false ,因此在从 FB 初始成功登录后,所有其他路由上的 ensureAuthentication 方法都失败了。我没有使用集群设置,所以我相信内存存储足以处理这个问题,快速配置看起来很好(我的意思是订单),这是我的快速配置
这是初始成功登录和重定向的req.session对象,req.user包含与req.session.passport.user相同的数据
这是我之前与策略内部的 done() 回调以及序列化调用内部相关联的信息。成功登录和回调后,我使用 res.redirect 将用户重定向到不同的路由,但来自该路由的请求包含 sessionID(所以我认为它不是会话存储的问题),但是 req.user字段不存在(可能是因为 passport.initialize() 和 passport.session() 中间件没有找到要认证的请求)并且 req.session.passport 字段为空,这里是 req 的 console.log 中的详细信息目的 。
这是我的反序列化方法
这是我的序列化方法
这对我的发展造成了很大的障碍,我该如何解决?