访问令牌可以超过255个字符吗? [英] Can access token be longer than 255 characters?

查看:98
本文介绍了访问令牌可以超过255个字符吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当允许通过OAuth(例如OpenID,Facebook,Twitter等)登录时,我们将Oath提供程序提供的访问令牌保存在mysql数据库中,以供将来进行身份验证.在某些教程中,用于保存访问令牌的列为varchar(255),而另一些则使用text.我想知道访问令牌(通过Facebook和Twitter等常见网站)是否超过255个字符,需要text列.我们应该考虑这种可能性吗?

When allowing login by OAuth (such as OpenID, Facebook, Twitter, etc), we save the access token given by the Oath provider in mysql database for future authentication. In some tutorials, the column for saving access token is varchar(255) and some use text. I wonder if the access token (by common websites such as facebook and twitter) is longer than 255 character needing text column. Should we consider this possibility?

推荐答案

根据我的经验,您不会遇到Facebook或Twitter的问题(3年来对我来说一直没有问题在我的系统上将其存储为长度255).也就是说,快速搜索确实在Quora http://www.quora.com/OAuth-1/Whats-the-maximum-length-of- OAuth访问令牌密钥秘密对

You won't run in to the problem with Facebook or Twitter from my experience (In 3+ years there hasn't been a problem for me on my systems storing it at length 255). That said, a quick search did bring up this question on Quora http://www.quora.com/OAuth-1/Whats-the-maximum-length-of-an-OAuth-access-token-key-secret-pair

这个答案太老了而且不正确.查看最新答案.不要限制访问令牌的大小.

This answer is incredibly old and incorrect. Look at the latest answers. Do not limit the size of the access token.

这篇关于访问令牌可以超过255个字符吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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