You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,7 @@ Sample projects using the library can be executed as docker or docker-compose. S
105
105
106
106
### SpringBoot Relying Party example
107
107
108
-
A simple [SpringBoot](examples/relying-party-spring-boot) web application using the starter-kit to implement a Relying Party.
108
+
A simple [SpringBoot](examples/relying-party-spring-boot) web application using the starter-kit to implement a Relying Party, as well to perform the complete onboarding and login/logout test within the CIE Federation.
109
109
110
110
This application is for demo purpose only, please don't use it in production or critical environment.
@@ -39,9 +39,10 @@ this will start the relying party server on [http://127.0.0.1:8080](http://127.0
39
39
Do the on-boarding process
40
40
- generate the relying party jwks
41
41
- go [here](http://127.0.0.1:8080/) to auto-generate it
42
-
- jwks are exposed on the page and inside application log
43
-
- create the file `${user.home}/oidc-rp-jwk.json` with the jwks
44
-
- use "reload" link to proceed with next step
42
+
- federation jwks and core jwks are exposed on the page and inside application log
43
+
- create the file `${user.home}/oidc-rp-jwk.json` with the federation jwks
44
+
- create the file `${user.home}/oidc-rp-core-jwk.json` with the core jwks
45
+
-- use "reload" link to proceed with next step
45
46
- show on-boarding datas
46
47
- go [here](http://127.0.0.1:8080/) to see it
47
48
- register the relying party [here](http://127.0.0.1:8000/admin/spid_cie_oidc_authority/federationdescendant/add)
@@ -76,10 +77,32 @@ A docker image containing this example can be built a run:
76
77
- visit `http://relying-party.org:8080/`
77
78
78
79
Some hints:
79
-
- we are using [federation](https://github.com/italia/spid-cie-oidc-django) v1.2.0
80
+
- we are using [federation](https://github.com/italia/spid-cie-oidc-django) v1.4.0
80
81
- docker images currently sets a proxy of the exposed ports on the localhost interface, so you could use
81
82
previous chapter instructions replacing `127.0.0.1` with the right hostname
82
-
- docker image mounts the folder `./docker/data-java` as `/data` inside spring-boot container to externalize `jwk` and `trust-marks` configuration
83
+
- docker image mounts the folder `./docker/data-java` as `/data` inside spring-boot container to externalize federation and core `jwks` and `trust-marks` configuration
83
84
84
85
85
86
[Docker Compose in action on YouTube](https://www.youtube.com/watch?v=U2Ec0No2EKg)
87
+
88
+
**To be onboarded into CIE Federation**:
89
+
- use always appropriate and valid TLS Certificates
90
+
- use IP from Italian networks for server [CIE Federation servers uses geoblocking]
91
+
- as contact use the same institutional email address as stated into the administrative part [do not use PEC]
92
+
- when copy the federation public key please follow this pattern:
93
+
-```
94
+
{
95
+
"keys": [
96
+
{
97
+
"alg": "RS256",
98
+
"kid": "....",
99
+
"kty": "RSA",
100
+
"n": ".....",
101
+
"e": "AQAB",
102
+
"use": "sig"
103
+
}
104
+
]
105
+
}
106
+
```
107
+
- when onboarded, please retrieve the Trust Mark form TA fetch endpoint like this example for preproduction: `https://preprod.oidc.registry.servizicie.interno.gov.it/fetch?sub={your_client_id}`
108
+
- remember to (put `[` `]` around the Trust Mark when writing the appropriate file
Copy file name to clipboardExpand all lines: examples/relying-party-spring-boot/src/main/java/it/spid/cie/oidc/spring/boot/relying/party/RelyingPartyWrapper.java
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -48,10 +48,10 @@ public JSONObject getUserInfo(String state, String code)
48
48
}
49
49
50
50
publicStringgetUserKey(JSONObjectuserInfo) {
51
-
StringuserKey = userInfo.optString("email");
51
+
StringuserKey = userInfo.optString("sub");
52
52
53
53
if (Validator.isNullOrEmpty(userKey)) {
54
-
userKey = userInfo.optString("email", "");
54
+
userKey = userInfo.optString("sub", "");
55
55
}
56
56
57
57
returnuserKey;
@@ -83,11 +83,12 @@ public void reloadHandler() throws OIDCException {
Copy file name to clipboardExpand all lines: examples/relying-party-spring-boot/src/main/java/it/spid/cie/oidc/spring/boot/relying/party/config/OidcConfig.java
+14-7Lines changed: 14 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -208,10 +208,12 @@ public Set<String> getRedirectUris() {
208
208
// return jwk;
209
209
// }
210
210
211
-
publicStringgetJwkFilePath() {
212
-
returnjwkFilePath;
211
+
publicStringgetJwkFedFilePath() {
212
+
returnjwkFedFilePath;
213
+
}
214
+
publicStringgetJwkCoreFilePath() {
215
+
returnjwkCoreFilePath;
213
216
}
214
-
215
217
// public String getTrustMarks() {
216
218
// return trustMarks;
217
219
// }
@@ -271,10 +273,13 @@ public void setFederationContacts(Set<String> federationContacts) {
0 commit comments