我是使用PostMan的新手;通常我使用curl:
I am new using PostMan; normally I use curl:
这个获得JTW的人
curl -X POST -H "X-Requested-With: XMLHttpRequest" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{ "username": "peris","password": "3nRam0nD3L3s0l1v3s" }' "139.152.231.107:1133/canPeris/auth"和另外一个使用之前获得的JTW
and this other one using the JTW obtained before
curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer eyJhbGciJIUzUxMiJ9.eyJzdWIiOiJsb3Blei5hbnRvbmlvODVAZ21haWwuY29tIiwiZXhwIjoxNTkwMDQ3NTg4LCJpYXQiOjE1Mh9.3vlQBgfA22ffJZqNic2lVSHiMR6YudlCFoldfwzdk-clz6_XyOvCVTrMihXtYBaJuPI515zTwAnaQBV_h4yquA" "139.152.231.107:1133/canPeris/api/v1/users/3/menus/vegans"我正在使用它来生成令牌
I am using this to generate the token
return io.jsonwebtoken.Jwts.builder() .setClaims(claims) .setSubject(subject) .setIssuedAt(createdDate) .setExpiration(expirationDate) .signWith(SignatureAlgorithm.HS512, secret) pact();但是在postMan Signature方法中,我没有找到HS512
but in the postMan Signature method I haven't found the HS512
推荐答案
我认为这可以解决您的问题.
I think this can solve your problem.
转到身份验证标签,然后选择承载者令牌:
添加您的令牌:
添加标头 Content-Type:Application/json ,如有必要:
发送您的请求.
如果您计划自动化获取访问令牌并在另一个请求中使用,我建议阅读有关邮递员测试和变量的信息: medium/@codebyjeff/using-postman-environment-variables-auth-tokens-ea9c4fe9d3d7
If you planing automate the access token acquisition and use in another request, I recommend read about postman tests and variables: medium/@codebyjeff/using-postman-environment-variables-auth-tokens-ea9c4fe9d3d7
更多推荐
使用JWT创建PostMan GET请求
发布评论