REST API project developed in Java using Spring Boot 3, Spring Security 6 for JWT Authentication and Authorization, and H2 database.
- Token-based Authentication using JSON Web Token (JWT)
- Role-based authorization
- Encoding password with BCrypt algorithm
- Java 17
- Spring Boot 3.x.x
- Spring Security 6.x.x
- Apache Maven 3.8.6
- spring-common-parent: Manages the Spring Boot version and provide common configurations for plugins and formatting.
To pull the spring-common-parent dependency, follow these steps:
-
Generate a Personal Access Token:
Go to your GitHub account -> Settings -> Developer settings -> Personal access tokens -> Tokens (classic) -> Generate new token (classic):
- Fill out the Note field:
Pull packages. - Set the scope:
read:packages(to download packages)
- Click Generate token.
- Fill out the Note field:
-
Set Up Maven Authentication:
In your local Maven
settings.xml, define the GitHub repository authentication using the following structure:<servers> <server> <id>github-spring-common-parent</id> <username>USERNAME</username> <password>TOKEN</password> </server> </servers>
NOTE: Replace
USERNAMEwith your GitHub username andTOKENwith the personal access token you just generated.
- Set the following environment variables:
DB_PASSWORD,ADMIN_PASSWORDandSECRET_KEY(size >= 256 bits). - Run the
SpringSecurityJwtApplicationclass as Java Application.
Follow the AWS Docker guide to deploy a Java App instance and how to set up Nginx as a reverse proxy with a valid Wildcard SSL/TLS certificate.