We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
之前一直觉得go的rest api轮子没有特别好用的,直到这几天发现强哥出了新的,甚是开心。 我是强哥的铁粉,早几年做PHP,跟随强哥的yii1,然后yii2,yii2 太好用了,至今没看的比yii2好用的框架。现在也跟随强哥的go轮子,在做golang了。
在使用的途中,发现登录之后,用token去创建 albums,提示401 signature is invalid
用jwt token的操作如下: curl -X POST -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1ODIzNjI4MjgsImlkIjoiMTAwIiwibmFtZSI6ImRlbW8ifQ.UBTz2RJ0l92JRwRYpqQpOiNoaTVx9kheRP7gt0Xv9XE" -d '{"name": "demo321"}' http://localhost:8080/v1/albums
{"status":401,"message":"signature is invalid"}
我自己尝试看懂代码,想自己解决,无奈golang还不是很熟练,看了很久也没能找到解决办法,期待强哥的回复。
The text was updated successfully, but these errors were encountered:
8e7306c
多谢你的支持!问题已经解决了,因为我们采用了HS256算法生成JWT,signing key 和 verification key应该是一样(对称)的。
Sorry, something went wrong.
qiangxue
No branches or pull requests
之前一直觉得go的rest api轮子没有特别好用的,直到这几天发现强哥出了新的,甚是开心。
我是强哥的铁粉,早几年做PHP,跟随强哥的yii1,然后yii2,yii2 太好用了,至今没看的比yii2好用的框架。现在也跟随强哥的go轮子,在做golang了。
在使用的途中,发现登录之后,用token去创建 albums,提示401 signature is invalid
用jwt token的操作如下:
curl -X POST -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1ODIzNjI4MjgsImlkIjoiMTAwIiwibmFtZSI6ImRlbW8ifQ.UBTz2RJ0l92JRwRYpqQpOiNoaTVx9kheRP7gt0Xv9XE" -d '{"name": "demo321"}' http://localhost:8080/v1/albums
{"status":401,"message":"signature is invalid"}
我自己尝试看懂代码,想自己解决,无奈golang还不是很熟练,看了很久也没能找到解决办法,期待强哥的回复。
The text was updated successfully, but these errors were encountered: