Skip to content

JavatoDev-com/spring-boot-rest-api-jwt-authentication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot JWT Authentication using Spring Security

Spring Boot JWT Authentication with REST API Tutorial

In this article, I’ll explain how we can implement a JWT (JSON Web Token) based authentication layer on Spring Boot CRUD API using Spring Security. Basically this JWT authentication layer will secure the API to avoid unauthorized API access.

Technologies Going to Use,

  • Java 1.8
  • Spring Boot: 2.3.4.RELEASE
  • Spring Security
  • JPA
  • MySQL
  • Lombok
  • Gradle
  • Intellij Idea for IDE

Main topics I’m going to discuss here,

  • What is JWT ?
  • How Does JWT Based Authentication work with Spring Boot?
  • Adding Required Dependencies
  • Developing API
    • Defining API Endpoints
    • Spring Security Related Implementation
      • API User Specific API Development
      • Authentication Filter with UsernamePasswordAuthenticationFilter
        • What is the use of Authentication Filter ?
      • JWT Authorization Filter with BasicAuthenticationFilter
        • What is the use of JWT authorization Filter ?
      • Authentication User Detail Service to Read User From Database
      • Security Configuration With WebSecurityConfigurerAdapter
    • Testing API with JWT Authentication
    • More Configurations inside JWT based Authentication Layer
      • Send JWT Authentication Token in Response Body After Successful Login
      • Role Based Authentication with JWT
    • Conclusion

📄 Original Tutorial Spring Boot JWT Authentication using Spring Security

Related Articles

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages