Skip to content

Kvark900/spring-boot-rest-api-jwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-boot-rest-api

Bookstore REST API with JWT authentication

Prerequisites

  • JDK 1.8+
  • Maven

Technology stack:

  • Spring Boot
  • Spring Data JPA
  • MySQL
  • Spring Security
  • JWT (JSON Web Tokens)

There are three user accounts :

Admin - admin:admin
User - user:password
Disabled - disabled:password (this user is disabled)

All endpoints for CRUD operations can be seen in:

/auth - authentication endpoint (HTTP method: POST) - place your credentials in JSON format in request body as JwtAuthenticationRequest 

Use Bearer Token for any listed request:
/authors/** - endpoint for CRUD operations on authors (a valid JWT token must be present in the request header)   
/books/** - endpoint for CRUD operations on books (a valid JWT token must be present in the request header)   
/topics/** - endpoint for CRUD operations on topics (a valid JWT token must be present in the request header)   

Set up MySQL

Configure database according to application.properties file, or update this file with yours properties.