JWT令牌的最大大小是多少? [英] What is the maximum size of JWT token?

查看:1150
本文介绍了JWT令牌的最大大小是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道

JSON Web令牌(JWT)

JSON Web Token (JWT)

在规格方面,没有关于它的信息.可能是,长度没有限制吗?

In specs there are no information about it. Could be that, there are no limitations in length ?

推荐答案

如您所说,RFC7519( https://tools.ietf.org/html/rfc7519 )或与JWS或JWE相关的其他RFC.

As you said, there is no maximum length defined in the RFC7519 (https://tools.ietf.org/html/rfc7519) or other RFCs related to JWS or JWE.

如果使用JSON序列化格式或JSON扁平化序列化格式,则没有限制,也没有理由定义限制.

If you use the JSON Serialized format or JSON Flattened Serialized format, there is no limitation and there is no reason to define a limitation.

但是,如果您使用JSON Compact Serialized格式(最常用的格式),则必须记住,它应尽可能短,因为它主要用于Web上下文.您应该避免使用4kb的JWT.

But if you use the JSON Compact Serialized format (most common format), you have to keep in mind that it should be as short as possible because it is mainly used in a web context. A 4kb JWT is something that you should avoid.

请注意仅存储有用的声明和标头信息.

Take care to store only useful claims and header informations.

这篇关于JWT令牌的最大大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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