Facebook用户信息仅使用OAuth令牌 [英] Facebook user information using only an OAuth Token

查看:152
本文介绍了Facebook用户信息仅使用OAuth令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于用户错误,出现了一个情况,其中我的数据库为Facebook用户持有一个Oauth令牌,没有该人的Facebook id,正确的名称或与Facebook帐户相关联的电子邮件。仅使用Oauth令牌,是否可以获取用户的Facebook ID或其他信息?

Due to user error, a situation has arisen in which my database holds an Oauth token for a facebook user without that person's facebook id, proper name, or the email linked with the facebook account. Using only the Oauth token, is it possible to get the user's facebook id or other information?

推荐答案

令牌包含所有信息您需要 - 如 Ben Biddington (可能还有许多其他地方)令牌的一部分(管道之间( | ))是会话密钥,格式如下:

The token holds all the information you need - as explained by Ben Biddington (and probably many other places) part of the token (between the pipes (|)) is the session-key, in this format:

2.{secret}.3600.{expires_at_seconds_after_epoch}-{user_id}

所以如果你的令牌看起来像

so if your token looks something like

1234567890|2.3onmAQCJpDQDrbT6.3600.1307484000.0-987654321|316cKUabM1Z-5X4P8k4sJdnW8ok

会话密钥

2.3onmAQCJpDQDrbT6.3600.1307484000.0-987654321

然后用户ID将为 987654321

这篇关于Facebook用户信息仅使用OAuth令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆