An open API service indexing awesome lists of open source software.

https://github.com/edgar-code-repository/demo-jwt-authentication

JWT authentication with Spring Boot 3.2.3 and Java 17.
https://github.com/edgar-code-repository/demo-jwt-authentication

java17 jwt-authentication springboot3

Last synced: about 2 months ago
JSON representation

JWT authentication with Spring Boot 3.2.3 and Java 17.

Awesome Lists containing this project

README

          

DEMO JWT AUTHENTICATION
--------------------------------------------------------------------------------------------------------------------

Application created with Spring Boot 3.2.3 and Java 17.

This Rest API returns a JWT Token when a user authenticates successfully.

![ScreenshotSpringAndJWT](screenshots/spring-and-jwt.png)

--------------------------------------------------------------------------------------------------------------------

This app uses Web, Spring Security, JWT and Lombok dependencies:

```

org.springframework.boot
spring-boot-starter-web


org.springframework.boot
spring-boot-starter-security


io.jsonwebtoken
jjwt-api
0.11.5


io.jsonwebtoken
jjwt-impl
0.11.5


io.jsonwebtoken
jjwt-jackson
0.11.5



org.projectlombok
lombok
true

```

--------------------------------------------------------------------------------------------------------------------

Call to authentication endpoint with Postman, which returns the JWT Token:

![ScreenshotPostmanAuthenticationEndpoint](screenshots/authentication_endpoint.png)

--------------------------------------------------------------------------------------------------------------------

Call to authentication endpoint with Postman, which returns HTTP 401 when authentication fails:

![ScreenshotPostmanAuthenticationEndpoint](screenshots/bad_credentials.png)

--------------------------------------------------------------------------------------------------------------------