什么字段类型存储facebook令牌? [英] What field type to store the facebook token?

查看:87
本文介绍了什么字段类型存储facebook令牌?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个简单的Facebook应用程序,我想将facebook令牌存储在我的mysql数据库中。我必须使用什么字段类型来存储Facebook令牌?

I have created a simple facebook app and I want to store the facebook token in my mysql database. What field type do I have to use to store the facebook token ?

推荐答案

您将要存储access_token以及user_id,您从Facebook身份验证API返回,所以如果您需要重新生成访问令牌,您可以使用用户ID。

You will want to store the access_token as well as the user_id that you get back from the facebook authentication API, so if you need to regenerate the access token you can do so with the user id.

请注意,Facebook将将逐步淘汰 offline_access 权限,这是大多数permament-auth样式应用程序的主干,其中访问令牌作为主验证凭据保存到数据库。这意味着无限期依赖一个访问令牌的旧服务器端方法将不再可能。有关此更改的详细信息,请访问:

Please be aware that Facebook will be phasing out the offline_access permission, which is the backbone of most permament-auth style apps where the access token is saved to the database as the main authentication credential. This will mean that the old server-side approach of relying on one access token indefinitely will no longer be possible. Details on this change can be found here:

https://developers.facebook.com/roadmap/offline-access-removal/

就字段类型而言,你可以存储为mysql VARCHAR(255)或TINYTEXT

As far as field types go, you can store both as mysql VARCHAR(255) or TINYTEXT

Facebook OAuth2中access_token的长度是多少?

这篇关于什么字段类型存储facebook令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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