This is a fork of Okta's Spring Boot Login Samples, without Okta Spring Boot Starter.
- Java 21
- On the Auth0 Dashboard create a new Application of type Regular Web Application.
- On the Settings tab of your application, add the following URLs to the Allowed Callback URLs field.
http://localhost:3000/login/oauth2/code/okta, http://localhost:3001/login/oauth2/code/okta
- On the Settings tab of your application, add the following URLs to the Allowed Logout URLs field.
http://localhost:3000, http://localhost:3001
- Save the changes to your application settings. Don't close this page; you'll need some of the settings when configuring the application below.
Create application.yml by copying example config:
cp mvc-login/src/main/resources/application.yml.example mvc-login/src/main/resources/application.yml
cp webflux-login/src/main/resources/application.yml.example webflux-login/src/main/resources/application.yml
Set the application values in the src/main/resources/application.yml
file to the values of your Auth0 application for both mvc-login and webflux-login subprojects.
issuer-uri: https://{YOUR-DOMAIN}/
client-id: {YOUR-CLIENT-ID}
client-secret: {YOUR-CLIENT-SECRET}
Open a terminal, go to the project root directory and run the following command:
Linux or MacOS:
./gradlew :mvc-login:bootRun
Windows:
gradlew.bat :mvc-login:bootRun
The application will be accessible at http://localhost:3000.
Open a terminal, go to the project root directory and run the following command:
Linux or MacOS:
./gradlew :webflux-login:bootRun
Windows:
gradlew.bat :webflux-login:bootRun
The application will be accessible at http://localhost:3001.
Use OpenRewrite to upgrade to latest Java and SpringBoot.
Define latest recipes in gradle/openrewrite.gradle
, and run:
./gradlew rewriteRun