This is a sample project demos how to use Auth0 IDP service to protect the RESTful APIs written in Spring WebMVC.
If you are interested in the custom JWT authentication with the Spring WebMvc stack, check spring-webmvc-jwt-sample for more details.
If you are interested in the custom JWT authentication with the Spring WebFlux stack, check spring-reactive-jwt-sample for more details.
Make sure you have installed the following software.
- Java 17 +
- Apache Maven 3.x
- Docker
Clone the source codes from Github.
git clone https://github.com/hantsy/spring-security-auth0-sample
Open a terminal, and switch to the root folder of the project, and run the following command to build the whole project.
docker-compose up postgres // start up a postgres
mvn clean install // build the project
Run the application.
mvn spring-boot:run
// or from command line after building
java -jar target/xxx.jar
Any suggestions are welcome, filing an issue or submitting a PR is also highly recommended.