且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Spring Boot中与JWT身份验证一起实现oAuth2?

更新时间:2023-09-02 10:33:16

MongoDB(或任何数据库)与JWT身份验证没有特别关系,因为资源服务器可以使用授权的公钥在本地验证JWT本身.服务器,而无需转到数据库(如您所说).

MongoDB (or any database) is not particularly relevant to the JWT authentication since the JWT itself can be validated locally by the resource server using the public key of the authorization server without going to the database (as you say).

密钥正在使用JwtTokenStore

The key is using a JwtTokenStore

我发现此github示例很有帮助: https://github.com /dsyer/spring-security-angular/tree/master/oauth2

I found this github sample helpful: https://github.com/dsyer/spring-security-angular/tree/master/oauth2

我还用jhipster创建了一个基本的jwt实现,供您查看.以下是jhipster为我生成的内容的更改: https://github.com/sdoxsee/jwt-jhipster/commit/40090fcf4fab1b556ae28532c4ba8a33e70460c9

I also created a basic jwt implementation with jhipster for you to look at. Here are the changes from what jhipster generated for me: https://github.com/sdoxsee/jwt-jhipster/commit/40090fcf4fab1b556ae28532c4ba8a33e70460c9