Skip to content

Commit 0ac66ba

Browse files
committed
Add Docker-based Identity Provider
Issue gh-127
1 parent 14b6bd4 commit 0ac66ba

27 files changed

+878
-0
lines changed

servlet/spring-boot/java/saml2/identity-provider/.idea/.gitignore

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

servlet/spring-boot/java/saml2/identity-provider/.idea/checkstyle-idea.xml

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

servlet/spring-boot/java/saml2/identity-provider/.idea/codeStyles

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

servlet/spring-boot/java/saml2/identity-provider/.idea/compiler.xml

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

servlet/spring-boot/java/saml2/identity-provider/.idea/gradle.xml

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

servlet/spring-boot/java/saml2/identity-provider/.idea/jarRepositories.xml

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

servlet/spring-boot/java/saml2/identity-provider/.idea/misc.xml

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

servlet/spring-boot/java/saml2/identity-provider/.idea/uiDesigner.xml

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

servlet/spring-boot/java/saml2/identity-provider/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
= SAML 2.0 Login & Logout Sample
2+
3+
This guide provides instructions on setting up this SAML 2.0 Login & Logout sample application.
4+
It uses https://simplesamlphp.org/[SimpleSAMLphp] as its asserting party.
5+
6+
The sample application uses Spring Boot and the `spring-security-saml2-service-provider`
7+
module which is new in Spring Security 5.2.
8+
9+
The https://docs.spring.io/spring-security/reference/servlet/saml2/logout.html[SAML 2.0 Logout feature] is new in Spring Security 5.6.
10+
11+
== Goals
12+
13+
=== SAML 2.0 Login
14+
15+
`saml2Login()` provides a very simple implementation of a Service Provider that can receive a SAML 2.0 Response via the HTTP-POST and HTTP-REDIRECT bindings against the https://developer.okta.com/docs/guides/build-sso-integration/saml2/main/[Okta SAML 2.0 IDP] reference implementation.
16+
17+
The following features are implemented in the MVP:
18+
19+
1. Receive and validate a SAML 2.0 Response containing an assertion, and create a corresponding authentication in Spring Security
20+
2. Send a SAML 2.0 AuthNRequest to an Identity Provider
21+
3. Provide a framework for components used in SAML 2.0 authentication that can be swapped by configuration
22+
4. Work against the Okta SAML 2.0 IDP reference implementation
23+
24+
=== SAML 2.0 Single Logout
25+
26+
`saml2Logout()` supports RP- and AP-initiated SAML 2.0 Single Logout via the HTTP-POST and HTTP-REDIRECT bindings against the https://developer.okta.com/docs/guides/build-sso-integration/saml2/main/[Okta SAML 2.0 IDP] reference implementation.
27+
28+
On this sample, the SAML 2.0 Logout is using the HTTP-POST binding.
29+
30+
You can refer to the https://docs.spring.io/spring-security/reference/servlet/saml2/logout.html[reference documentation] for more details about the RP- and AP-initiated SAML 2.0 Logout.
31+
32+
== Run the Sample
33+
34+
=== Start up the Sample Boot Application
35+
```
36+
./gradlew :servlet:spring-boot:java:saml2:login:bootRun
37+
```
38+
39+
=== Open a Browser
40+
41+
http://localhost:8080/
42+
43+
You will be redirect to the Okta SAML 2.0 IDP
44+
45+
=== Type in your credentials
46+
47+
```
48+
49+
Password: 12345678
50+
```
51+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
plugins {
2+
alias(libs.plugins.org.springframework.boot)
3+
alias(libs.plugins.io.spring.dependency.management)
4+
id "nebula.integtest" version "8.2.0"
5+
id 'java'
6+
}
7+
8+
repositories {
9+
mavenCentral()
10+
maven { url "https://repo.spring.io/milestone" }
11+
maven { url "https://repo.spring.io/snapshot" }
12+
}
13+
14+
15+
dependencies {
16+
implementation 'org.springframework.boot:spring-boot-starter'
17+
runtimeOnly "org.springframework.boot:spring-boot-docker-compose"
18+
}
19+
20+
tasks.withType(Test).configureEach {
21+
useJUnitPlatform()
22+
23+
}
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=6.4.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
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
4+
networkTimeout=10000
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)