uhudpoyraz / spring-security-jwt

In this article, we will be creating a sample REST CRUD APIs and provide JWT role based authorization using spring security to these APIs. We will be using spring boot 2.0 and JWT 0.9.0. In the DB, we will have two roles defined as ADMIN and USER with custom UserDetailsService implemented and based on these roles the authorization will be decided. We will be using spring data to perform our CRUD operations and spring provided annotations such as @PreAuthorize, @Secured and @EnableGlobalMethodSecurity for authorization.

Home Page:http://www.devglan.com/spring-security/jwt-role-based-authorization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring Boot Security Jwt Authentication

This is a sample project to provide example on how to add JWT token authentication in a spring boot application. The example uses maven as a build tool and also sample script to run on application startup so that anybody can get started by simply running Application.java

The complete explanation can be found on my blog here - Spring Boot Security JWT Authentication

Technology Used

  1. Spring Boot (1.5.8.RELEASE)
  2. JWT (0.6.0)
  3. Mysql
  4. Java 1.8

Similar Post

You may be interested in other spring security articles:

Spring Boot Security OAUTH2 Example.

Spring Boot Security Basic Authentication

Spring Boot Security Hibernate Login

Securing Actuator Endpoints with Spring Security

About

In this article, we will be creating a sample REST CRUD APIs and provide JWT role based authorization using spring security to these APIs. We will be using spring boot 2.0 and JWT 0.9.0. In the DB, we will have two roles defined as ADMIN and USER with custom UserDetailsService implemented and based on these roles the authorization will be decided. We will be using spring data to perform our CRUD operations and spring provided annotations such as @PreAuthorize, @Secured and @EnableGlobalMethodSecurity for authorization.

http://www.devglan.com/spring-security/jwt-role-based-authorization


Languages

Language:Java 100.0%