Skip to content

REST API designed to demonstrate the use of Spring Security for Authentication and Authorization

Notifications You must be signed in to change notification settings

thesarfo/springsecurity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot and Spring Security Starter Pack

This is a spring boot and spring security implementation that comes with

  • Jwt
  • Oauth2
  • Refresh Tokens
  • a RESTful API
  • Unit and Integration Tests

Rest Api Endpoints

Click here
Method Url Description Request Body Header Valid Path Variable No Path Variable
POST /api/v1/authentication/admin/register Admin Register AdminRegisterRequest
POST /api/v1/authentication/admin/login Admin Login LoginRequest
POST /api/v1/authentication/admin/refreshtoken Admin Refresh Token TokenRefreshRequest
POST /api/v1/authentication/admin/logout Admin Logout TokenInvalidateRequest
POST /api/v1/authentication/user/register User Register UserRegisterRequest
POST /api/v1/authentication/user/login User Login LoginRequest
POST /api/v1/authentication/user/refreshtoken User Refresh Token TokenRefreshRequest
POST /api/v1/authentication/user/logout User Logout TokenInvalidateRequest
POST /api/v1/products Create Product ProductCreateRequest
GET /api/v1/products/{productId} Get Product By Id ProductId
GET /api/v1/products Get Products ProductPagingRequest
PUT /api/v1/products/{productId} Update Product By Id ProductUpdateRequest ProductId
DELETE /api/v1/products/{productId} Delete Product By Id ProductId

Built with


  • Java 17
  • Spring Boot 3.0
  • Lombok
  • Maven
  • Junit5
  • Mockito
  • Integration Tests
  • Docker
  • Docker Compose

Prerequisites

Define Variables in .env file

DATABASE_USERNAME={DATABASE_USERNAME}
DATABASE_PASSWORD={DATABASE_PASSWORD}

  • Maven or Docker

Docker Run

The application can be built and run by the Docker engine. The Dockerfile has multistage build, so you don;t need to build and run separately.

Follow directions shown below in order to build and run the application with Docker Compose file;

$ cd springsecurity
$ docker-compose up -d

If you change anything in the project and run it on Docker, you can also use this command shown below

$ cd springsecurity
$ docker-compose up --build

Maven Run

To build and run the application with Maven, please follow the directions shown below;

$ cd springsecurity
$ mvn clean install
$ mvn spring-boot:run

Screenshots

Click here

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Figure 14

Figure 15

Figure 16

About

REST API designed to demonstrate the use of Spring Security for Authentication and Authorization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages