-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* prep for webflux module * Setup webflux * WebFlux update logout url to port 3001 * separate job for webflux * update README * github actions separate mvc and webflux subprojects * Refactor mvc vs webflux packages * Make public for unit test * Update WebFlux Theme Templates
- Loading branch information
Showing
55 changed files
with
1,242 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# sample-oauth2-spring-boot - MVC | ||
|
||
## Description | ||
|
||
This is a fork of Okta's [Spring Boot Login - MVC](https://github.com/auth0-samples/auth0-spring-boot-login-samples/tree/master/mvc-login), without Okta Spring Boot Starter. | ||
|
||
## Requirements | ||
|
||
- Java 21 | ||
|
||
## Configuration | ||
|
||
### Auth0 Dashboard | ||
1. On the [Auth0 Dashboard](https://manage.auth0.com/#/clients) create a new Application of type **Regular Web Application**. | ||
1. On the **Settings** tab of your application, add the URL `http://localhost:3000/login/oauth2/code/okta` to the **Allowed Callback URLs** field. | ||
1. On the **Settings** tab of your application, add the URL `http://localhost:3000/` to the **Allowed Logout URLs** field. | ||
1. Save the changes to your application settings. Don't close this page; you'll need some of the settings when configuring the application below. | ||
|
||
### Application configuration | ||
|
||
Create application.yml by copying example config: | ||
|
||
```bash | ||
cp src/main/resources/application.yml.example src/main/resources/application.yml | ||
``` | ||
|
||
Set the application values in the `src/main/resources/application.yml` file to the values of your Auth0 application. | ||
|
||
```yaml | ||
issuer-uri: https://{YOUR-DOMAIN}/ | ||
client-id: {YOUR-CLIENT-ID} | ||
client-secret: {YOUR-CLIENT-SECRET} | ||
``` | ||
## Running the Spring MVC Sample | ||
Open a terminal, go to the project root directory and run the following command: | ||
Linux or MacOS: | ||
```bash | ||
./gradlew bootRun | ||
``` | ||
|
||
Windows: | ||
|
||
```bash | ||
gradlew.bat bootRun | ||
``` | ||
|
||
The application will be accessible at http://localhost:3000. | ||
|
||
### Running the sample with podman | ||
|
||
In order to run the example with [Podman](https://podman.io/docs/installation) you need to have `podman` installed. | ||
|
||
You also need to set the client values as explained [previously](#application-configuration). | ||
|
||
Execute the command to run Podman for your environment: | ||
|
||
Linux or MacOS: | ||
|
||
```bash | ||
sh exec.sh | ||
``` | ||
|
||
Windows: | ||
|
||
```bash | ||
.\exec.ps1 | ||
``` | ||
|
||
The application will be accessible at http://localhost:3000. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
plugins { | ||
id 'java' | ||
id 'jacoco' | ||
|
||
// https://plugins.gradle.org/plugin/org.springframework.boot | ||
id 'org.springframework.boot' version '3.3.5' | ||
// https://plugins.gradle.org/plugin/io.spring.dependency-management | ||
id 'io.spring.dependency-management' version '1.1.6' | ||
} | ||
|
||
ext { | ||
springBootVersion = '3.3.5' | ||
} | ||
|
||
group = 'org.example' | ||
version = '1.0-SNAPSHOT' | ||
|
||
java { | ||
sourceCompatibility = '21' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
// | ||
// SpringBoot | ||
// | ||
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web | ||
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: "${springBootVersion}" | ||
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-oauth2-client | ||
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-oauth2-client', version: "${springBootVersion}" | ||
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test | ||
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: "${springBootVersion}" | ||
|
||
// | ||
// Thymeleaf | ||
// | ||
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf | ||
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf', version: "${springBootVersion}" | ||
// https://mvnrepository.com/artifact/org.thymeleaf.extras/thymeleaf-extras-springsecurity6 | ||
implementation group: 'org.thymeleaf.extras', name: 'thymeleaf-extras-springsecurity6', version: '3.1.2.RELEASE' | ||
// https://mvnrepository.com/artifact/nz.net.ultraq.thymeleaf/thymeleaf-layout-dialect | ||
implementation group: 'nz.net.ultraq.thymeleaf', name: 'thymeleaf-layout-dialect', version: '3.3.0' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
// report is always generated after tests run | ||
finalizedBy jacocoTestReport | ||
} | ||
jacocoTestReport { | ||
reports { | ||
xml.required = true | ||
csv.required = true | ||
html.required = true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
podman build -t sample-oauth2-spring-boot-mvc . | ||
podman run -p 3000:3000 -it sample-oauth2-spring-boot-mvc |
Oops, something went wrong.