我使用Auth0-Lock对用户进行身份验证。但Auth0的回应数据似乎不包括Facebook user_id。我想得到user_id,因为我需要它在我的应用程序中显示用户的配置文件URL,比如:www.facebook.com/{user_id}。
{
"sub": "facebook|1613270415401150",
"given_name": "Steve",
"family_name": "Giáp",
"nickname": "hgbk.it",
"name": "Steve Giáp",
"picture": "https://graph.facebook.com/v2.5/1613270415401150/picture?width=720",
"gender": "male",
"locale": "en-GB",
"updated_at": "2018-10-09T04:25:12.921Z"
}来自sub或picture的Id与user_id无关。
发布于 2018-10-09 12:15:52
user_id Auth0使用的是身份提供者提供的id,而在Facebook的情况下,它们现在是应用范围。因此,user_id不是用户的用户id,而是这个特定应用程序的用户标识符。根据Facebook文档 The id of this person's user account. This ID is unique to each app and cannot be used across different apps.,这是Auth0作为user_id使用的id,在管道之后,例如facebook|<id from Facebook>。我相信你曾经能够用那个id来查看一个人的公共信息,但是Facebook已经不再支持提供username了。
https://stackoverflow.com/questions/52713383
复制相似问题