需要帮助尝试理解 OAuth2 规范
不记名令牌规范是我的规范有疑问。我试图弄清楚当放置在 Authorization: OAuth ......
标头中时,令牌中允许使用哪些字符。这是规范所说的
凭证 =“OAuth2”RWS 访问令牌 [ RWS 1#auth-param ]
访问令牌 = 1*( 带引号的字符 / <">; )引用字符=“!” /“#”/“$” /“%”/“&” /“'”/“(” /“)”/“*”/“+”/“-”/“。” /“/”/数字 /“:”/“<” /“=”/“>” /“?” /“@”/阿尔法 /“[”/“]”/“^”/“_”/“`”/“{”/“|” / "}" / "~" / "" / "," / ";"
我不知道如何阅读这个。我是阅读 RFC 的新手,所以如果有人可以解释它,我将不胜感激。
The bearer token spec is the one I have a question about. I'm trying to figure out what characters are allowed in the token when placed in the Authorization: OAuth ......
header. Here's what the spec says
credentials = "OAuth2" RWS
access-token [ RWS 1#auth-param ]
access-token = 1*( quoted-char / <">
)quoted-char = "!" / "#" / "$"
/ "%" / "&" / "'" / "("
/ ")" / "*" / "+" / "-" / "." / "/" / DIGIT
/ ":" / "<" / "=" / ">" / "?" / "@" / ALPHA
/ "[" / "]" / "^" / "_" / "`" / "{" / "|"
/ "}" / "~" / "" / "," / ";"
I'm not sure how to read this. I'm new at reading RFC's so if someone could explain it I would appreciate it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它看起来像是 HTTP/1.1 规范 (RFC2616) 中增强的 BNF:
http://www.rfc2616.com/ #2.1
It looks like it's augmented BNF from the HTTP/1.1 spec (RFC2616):
http://www.rfc2616.com/#2.1
您可以简单地使用 Base64 编码。
但它不使用 BNF 中的某些字符(例如“!”、“#”..)。
如果您想知道所有允许的字符,
“!” / "#" / "$" / "%" 表示允许使用所有这些字符("!"、"#"、"$"、"%")。
You can simply use Base64 encode.
It doesn't use some of characters (ex. "!", "#"..) in the BNF though.
If you want to know all allowed characters,
"!" / "#" / "$" / "%" means all these characters ("!", "#", "$", "%") are allowed.