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?
If the token's still valid, try fetching https://graph.facebook.com/me?fields=id&access_token=____
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
the session-key is
2.3onmAQCJpDQDrbT6.3600.1307484000.0-987654321
and then the user id will be 987654321
精彩评论