9

JWT在不同库中的实现差异问题

 3 years ago
source link: https://jimolonely.github.io/2019/09/28/basic/022-jwt-pro-between-different-lib/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

JWT在不同库中的实现差异问题

今天需要跨系统验证JWT时发现验证不通过:

A(java,采用jjwt生成)

B(python,采用python-jose生成)

同样的secret key,但是相互验证通不过。

原因:base64编码,jjwt编码的方式不一样。

解决办法:换一个java jwt库:auth0/java-jwt

这下就通过了,其实js也有问题,jjwt和官网的结果也有区别。

Share


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK