Skip to content

abha8517/spring-boot-3-security

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot 3 with Spring Security 6


Thank you for visiting this repository.
I hope you find what you are looking for, otherwise please do let me know.
I will try to make this repository as complete as possible.

Do not forget to follow the repository for further updates.

Installation prerequisites

Installation steps

  • Open Docker Desktop
  • Open this repository within your preferred IDE
  • Open a terminal within your IDE on location yourlocation\spring-boot-3-security
  • Type docker compose up -d
  • Now start the application
  • Open the database on: http://localhost:5050
  • Add a database called postgres
  • Use the credentials as per the application-database.yml file (located within folder: yourlocation\spring-boot-3-security\src\main\resources)

API overview

Context path: /auth

/authenticate

Description: Authenticate a user
Request URL: http://localhost:8081/api/v3/auth/authenticate

Example JSON Body:

{
  "usernameOrEmail": "admin",
  "password": "Admin123!"
}

Other login credentials:

user
User123!
moderator
Moderator123!

/register

Description: Register a new user
Request URL: http://localhost:8081/api/v3/auth/register

Example JSON Body:

{
  "firstName": "Jeffrey",
  "lastName": "Spaan",
  "email": "[email protected]",
  "username": "myusername",
  "password": "mypassword"
}

Context path: /demo


Description: Demo API for testing purposes
Request URL: http://localhost:8081/api/v3/demo

Context path: /users


Description: Retrieve a list of all registered users
Required: Authorization Bearer token
Request URL: http://localhost:8081/api/v3/users

/id
Description: Retrieve a registered user by its ID
Required: Authorization Bearer token
Request URL: http://localhost:8081/api/v3/users/1

/id

Description: Update a registered user by its ID
Request URL: http://localhost:8081/api/v3/users/1

Example JSON Body:

{
  "firstName": "Jeffrey",
  "lastName": "Spaan",
  "email": "[email protected]",
  "username": "myupdatedusername",
  "password": "myupdatedpassword"
}

/id
Description: Delete a registered user by its ID
Required: Authorization Bearer token
Request URL: http://localhost:8081/api/v3/users/1

More to follow...

About

Spring Boot 3 with Spring Security 6

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%