Skip to content

Commit 5f22333

Browse files
committed
Add OAuth2 Step-Up Sample
This sample illustrates how we can request additional scopes in a granular way should the user initially refuse.
1 parent 2f9b545 commit 5f22333

File tree

20 files changed

+927
-0
lines changed

20 files changed

+927
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
HELP.md
2+
.gradle
3+
build/
4+
!gradle/wrapper/gradle-wrapper.jar
5+
!**/src/main/**/build/
6+
!**/src/test/**/build/
7+
8+
### STS ###
9+
.apt_generated
10+
.classpath
11+
.factorypath
12+
.project
13+
.settings
14+
.springBeans
15+
.sts4-cache
16+
bin/
17+
!**/src/main/**/bin/
18+
!**/src/test/**/bin/
19+
20+
### IntelliJ IDEA ###
21+
.idea
22+
*.iws
23+
*.iml
24+
*.ipr
25+
out/
26+
!**/src/main/**/out/
27+
!**/src/test/**/out/
28+
29+
### NetBeans ###
30+
/nbproject/private/
31+
/nbbuild/
32+
/dist/
33+
/nbdist/
34+
/.nb-gradle/
35+
36+
### VS Code ###
37+
.vscode/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This application uses Spring Boot Docker Compose to start a [Maildev](https://github.com/maildev/maildev) container.
2+
3+
After requesting a token on `http://localhost:8080/login`, access `http://localhost:1080` to verify the email containing the magic link.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
plugins {
2+
id 'java'
3+
alias(libs.plugins.io.spring.dependency.management)
4+
alias(libs.plugins.org.springframework.boot)
5+
}
6+
7+
java {
8+
toolchain {
9+
languageVersion = JavaLanguageVersion.of(17)
10+
}
11+
}
12+
13+
repositories {
14+
mavenLocal()
15+
mavenCentral()
16+
maven { url "https://repo.spring.io/milestone" }
17+
maven { url "https://repo.spring.io/snapshot" }
18+
}
19+
20+
dependencies {
21+
implementation 'org.springframework.boot:spring-boot-starter-security'
22+
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
23+
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
24+
implementation 'org.springframework.boot:spring-boot-starter-web'
25+
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6'
26+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
27+
testImplementation 'org.springframework.security:spring-security-test'
28+
testImplementation 'com.icegreen:greenmail-junit5:2.0.1'
29+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
30+
}
31+
32+
tasks.named('test') {
33+
useJUnitPlatform()
34+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
version=6.1.1
2+
spring-security.version=7.0.0-SNAPSHOT
3+
org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError
4+
org.gradle.caching=true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../../../gradle/libs.versions.toml
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

servlet/spring-boot/java/authentication/mfa/oauth2/gradlew

Lines changed: 249 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)