导入依赖
- <dependency>
- <groupId>io.jsonwebtoken</groupId>
- <artifactId>jjwt</artifactId>
- <version>0.12.3</version>
- </dependency>
复制代码 包括了下面三个依赖, 所以导入上面一个就OK了
- <dependency>
- <groupId>io.jsonwebtoken</groupId>
- <artifactId>jjwt-api</artifactId>
- <version>0.12.3</version>
- </dependency>
- <dependency>
- <groupId>io.jsonwebtoken</groupId>
- <artifactId>jjwt-impl</artifactId>
- <version>0.12.3</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>io.jsonwebtoken</groupId>
- <artifactId>jjwt-jackson</artifactId> <!-- or jjwt-gson if Gson is preferred -->
- <version>0.12.3</version>
- <scope>runtime</scope>
- </dependency>
复制代码 之前许多方法都弃用了, 许多多少博文也还是用的废弃的方法
参考:
- https://github.com/jwtk/jjwt
- https://jwt.io/
- https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |