使用 Postman 在标头中发送 JWT 令牌 [英] Sending JWT token in the headers with Postman
问题描述
我正在测试基于以下内容的基于 JWT 令牌的安全性文章.我已成功收到来自测试服务器的令牌.我不知道如何让 Chrome POSTMAN REST 客户端程序在标头中发送令牌.
I'm testing an implementation of JWT Token based security based off the following article. I have successfully received a token from the test server. I can't figure out how to have the Chrome POSTMAN REST Client program send the token in the header.
我的问题如下:
1) 我是否使用了正确的标题名称和/或 POSTMAN 接口?
1) Am I using the right header name and/or POSTMAN interface?
2) 我需要对令牌进行 base 64 编码吗?我以为我可以把令牌寄回去.
2) Do I need to base 64 encode the token? I thought I could just send the token back.
推荐答案
对于请求 Header 名称,只需使用 Authorization.将 Bearer 放在 Token 之前.我刚刚试了一下,对我有用.
For the request Header name just use Authorization. Place Bearer before the Token. I just tried it out and it works for me.
授权:不记名TOKEN_STRING
Authorization: Bearer TOKEN_STRING
JWT 的每一部分都是一个 base64url 编码的值.
Each part of the JWT is a base64url encoded value.
这篇关于使用 Postman 在标头中发送 JWT 令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!