Skip to content

Commit 58ba384

Browse files
committed
Update READMEs
- Stated Docker dependencies - Updated u/p information
1 parent d358e80 commit 58ba384

File tree

3 files changed

+113
-89
lines changed

3 files changed

+113
-89
lines changed

servlet/spring-boot/java/saml2/login/README.adoc

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,45 @@ module which is new in Spring Security 5.2.
88

99
The https://docs.spring.io/spring-security/reference/servlet/saml2/logout.html[SAML 2.0 Logout feature] is new in Spring Security 5.6.
1010

11+
== Run the Sample
12+
13+
=== Install Docker
14+
15+
This sample requires Docker to run a local IdP.
16+
As an alternative, you can point the sample at your own IdP by changing the `application.yml` here:
17+
18+
[source,java]
19+
----
20+
spring:
21+
security:
22+
saml2:
23+
relyingparty:
24+
registration:
25+
one:
26+
assertingparty.metadata-uri: {your-idp-metadata-endpoint}
27+
// ...
28+
two:
29+
assertingparty.metadata-uri: {your-idp-metadata-endpoint}
30+
----
31+
32+
=== Start up the Sample Boot Application
33+
```
34+
./gradlew :servlet:spring-boot:java:saml2:login:bootRun
35+
```
36+
37+
=== Open a Browser
38+
39+
http://localhost:8080/
40+
41+
You will be redirected to the SimpleSAMLPHP instance.
42+
43+
=== Type in your credentials
44+
45+
```
46+
User: user1
47+
Password: user1pass
48+
```
49+
1150
== Goals
1251

1352
=== SAML 2.0 Login
@@ -29,28 +68,3 @@ On this sample, the SAML 2.0 Logout is using the HTTP-POST binding.
2968

3069
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.
3170

32-
== Run the Sample
33-
34-
=== Prerequisites
35-
36-
This sample requires Docker in order to stand up the identity provider.
37-
If you don't have Docker, you can alternatively disable Docker in `application.yml` and stand up your own IdP.
38-
39-
=== Start up the Sample Boot Application
40-
```
41-
./gradlew :servlet:spring-boot:java:saml2:login:bootRun
42-
```
43-
44-
=== Open a Browser
45-
46-
http://localhost:8080/
47-
48-
You will be redirected to a chooser page where you can pick between one of two identity providers.
49-
50-
=== Type in your credentials
51-
52-
```
53-
User: user1
54-
Password: user1pass
55-
```
56-

servlet/spring-boot/java/saml2/refreshable-metadata/README.adoc

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,37 @@ module which is new in Spring Security 5.2.
88

99
The https://docs.spring.io/spring-security/reference/servlet/saml2/logout.html[SAML 2.0 Logout feature] is new in Spring Security 5.6.
1010

11+
== Run the Sample
12+
13+
=== Install Docker
14+
15+
This sample requires Docker to run a local IdP.
16+
As an alternative, you can point the sample at your own IdP by changing the `application.yml` here:
17+
18+
[source,java]
19+
----
20+
saml2:
21+
ap.metadata: {your-idp-metadata-endpoint}
22+
----
23+
24+
=== Start up the Sample Boot Application
25+
```
26+
./gradlew :servlet:spring-boot:java:saml2:refreshable-metadata:bootRun
27+
```
28+
29+
=== Open a Browser
30+
31+
http://localhost:8080/
32+
33+
You will be redirected to the SimpleSAMLPHP instance.
34+
35+
=== Type in your credentials
36+
37+
```
38+
User: user1
39+
Password: user1pass
40+
```
41+
1142
== Goals
1243

1344
=== SAML 2.0 Login
@@ -32,27 +63,7 @@ You can refer to the https://docs.spring.io/spring-security/reference/servlet/sa
3263
=== Refreshable Asserting Party Metadata
3364

3465
The application uses a custom implementation of `RelyingPartyRegistrationRepository` to achieve Asserting Party Metadata refresh feature.
35-
This particular implementation uses a `@Scheduled` annotation to update its metadata every 30 minutes.
36-
37-
== Run the Sample
38-
39-
=== Start up the Sample Boot Application
40-
```
41-
./gradlew :servlet:spring-boot:java:saml2:refreshable-metadata:bootRun
42-
```
43-
44-
=== Open a Browser
45-
46-
http://localhost:8080/
47-
48-
You will be redirect to the Okta SAML 2.0 IDP
49-
50-
=== Type in your credentials
51-
52-
```
53-
54-
Password: 12345678
55-
```
66+
This particular implementation relies on an OpenSAML component that refreshes the metadata.
5667

5768

5869

servlet/spring-boot/java/saml2/saml-extension-federation/README.adoc

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,45 @@ This code uses `RelyingPartyRegistrations#collectionFromMetadata` to demonstrate
77

88
See the https://github.com/spring-projects/spring-security/wiki/SAML-2.0-Migration-Guide[SAML 2.0 Migration Guide] for more details about the migration.
99

10+
== Run the Sample
11+
12+
=== Install Docker
13+
14+
This sample requires Docker to run a local IdP.
15+
As an alternative, you can point the sample at your own IdP by changing the `application.yml` here:
16+
17+
[source,java]
18+
----
19+
spring:
20+
security:
21+
saml2:
22+
relyingparty:
23+
registration:
24+
one:
25+
assertingparty.metadata-uri: {your-idp-metadata-endpoint}
26+
// ...
27+
two:
28+
assertingparty.metadata-uri: {your-idp-metadata-endpoint}
29+
----
30+
31+
=== Start up the Sample Boot Application
32+
```
33+
./gradlew :servlet:spring-boot:java:saml2:saml-extension-federation:bootRun
34+
```
35+
36+
=== Open a Browser
37+
38+
http://localhost:8080/
39+
40+
You will be redirected to the SimpleSAMLPHP instance.
41+
42+
=== Type in your credentials
43+
44+
```
45+
User: user1
46+
Password: user1pass
47+
```
48+
1049
== Key Changes
1150

1251
=== URL Forwarding Filter
@@ -51,48 +90,8 @@ public class SamlExtensionUrlForwardingFilter extends OncePerRequestFilter {
5190
}
5291
----
5392

54-
=== application.yml
55-
56-
[source%linenums,yml]
57-
----
58-
spring:
59-
security:
60-
filter:
61-
dispatcher-types: async, error, request, forward <1>
62-
saml2:
63-
relyingparty:
64-
registration:
65-
one:
66-
singlelogout:
67-
binding: POST
68-
url: "{baseUrl}/saml/logout" <2>
69-
responseUrl: "{baseUrl}/saml/SingleLogout" <3>
70-
acs:
71-
location: "{baseUrl}/saml/SSO" <4>
72-
assertingparty.metadata-uri: https://dev-05937739.okta.com/app/exk598vc9bHhwoTXM5d7/sso/saml/metadata
73-
----
74-
75-
==== `RelyingPartyRegistration` properties
93+
=== `RelyingPartyMetadata` configuration component
7694

77-
The `RelyingPartyRegistration` properties should also be customized to match the values that were used by the SAML Extension (see <2>, <3> and <4> above).
95+
The `RelyingPartyRegistration` properties are customized to match the values that were used by the SAML Extension.
7896

79-
== Run the Sample
80-
81-
=== Start up the Sample Boot Application
82-
```
83-
./gradlew :servlet:spring-boot:java:saml2:saml-extension-federation:bootRun
84-
```
85-
86-
=== Open a Browser
87-
88-
http://localhost:8080/
89-
90-
Select the first IdP listed.
91-
You will be redirect to the Okta SAML 2.0 IDP
92-
93-
=== Type in your credentials
94-
95-
```
96-
97-
Password: 12345678
98-
```
97+
These reside in `RelyingPartyMetadata`.

0 commit comments

Comments
 (0)