Compare commits
552
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46a6c0e002 | ||
|
|
6bec306173 | ||
|
|
21e0f600c0 | ||
|
|
3ab8917e01 | ||
|
|
11cc678296 | ||
|
|
7428d969f0 | ||
|
|
179dde5f55 | ||
|
|
07369b7e1a | ||
|
|
3db1d28a5a | ||
|
|
8b771e5ce6 | ||
|
|
cdbe4e2423 | ||
|
|
a58595e210 | ||
|
|
84d543b232 | ||
|
|
8fba58c7a7 | ||
|
|
4f3764371a | ||
|
|
964fabb5f1 | ||
|
|
5679946ff3 | ||
|
|
13f1d742da | ||
|
|
a9691844bc | ||
|
|
34f1e8b74b | ||
|
|
5da837abf7 | ||
|
|
acd9dc4b82 | ||
|
|
e349f4734b | ||
|
|
eb324d3516 | ||
|
|
7a3a0469b4 | ||
|
|
f3f2fb1ae1 | ||
|
|
d27beb5688 | ||
|
|
4db7e8b964 | ||
|
|
7a365329c9 | ||
|
|
6f9c46488b | ||
|
|
06ab9c9dcf | ||
|
|
429bae62ec | ||
|
|
8024f71799 | ||
|
|
2a9548d27b | ||
|
|
8f11d08aa2 | ||
|
|
1085a4c9f6 | ||
|
|
05b2fbb6da | ||
|
|
d263f0af51 | ||
|
|
bf18c88655 | ||
|
|
1747368f2f | ||
|
|
04860906e7 | ||
|
|
27b9a880b0 | ||
|
|
9b47a4d1c5 | ||
|
|
0cac57c64e | ||
|
|
574e306271 | ||
|
|
88d65409aa | ||
|
|
cc29c9c6ad | ||
|
|
51d3dd2ee0 | ||
|
|
78188c9865 | ||
|
|
d04eda276e | ||
|
|
45fcf76db1 | ||
|
|
e526a22ecb | ||
|
|
52c3066fdc | ||
|
|
aab94084d4 | ||
|
|
5e7bdb1742 | ||
|
|
0e50bd24df | ||
|
|
1d06fe5253 | ||
|
|
10e9cc43e3 | ||
|
|
58a3d9efc9 | ||
|
|
e152711aec | ||
|
|
0533bd7e67 | ||
|
|
e72e20b6dd | ||
|
|
3aa0a59609 | ||
|
|
5d6ae2583c | ||
|
|
4de70b9110 | ||
|
|
c0e2f01c45 | ||
|
|
9047314a1f | ||
|
|
11351692ac | ||
|
|
a583c7d399 | ||
|
|
3aaecbf0de | ||
|
|
d921c133a7 | ||
|
|
5dc8e6b8b5 | ||
|
|
4f993eb1cc | ||
|
|
cdea5829e3 | ||
|
|
4045c4c683 | ||
|
|
e85f065b6a | ||
|
|
ce3319d9fa | ||
|
|
6362aa8773 | ||
|
|
8ef52b35c9 | ||
|
|
fe8fd76d7c | ||
|
|
2f47d99c98 | ||
|
|
5d80e21062 | ||
|
|
4494cd9ea9 | ||
|
|
4d3fbbaa32 | ||
|
|
bad3debfc3 | ||
|
|
b8d7c20cd6 | ||
|
|
8f28504a50 | ||
|
|
803ae2cdcd | ||
|
|
40d437af57 | ||
|
|
cc4c2622a2 | ||
|
|
26c6b4b624 | ||
|
|
d9fe19c438 | ||
|
|
4c612fbde3 | ||
|
|
5531fab517 | ||
|
|
c50564388a | ||
|
|
16bb58e2c6 | ||
|
|
631ac7bcc9 | ||
|
|
e0a0d58853 | ||
|
|
73a060adbb | ||
|
|
5e699682ae | ||
|
|
6474db1e3d | ||
|
|
c7787136c8 | ||
|
|
c02b43685f | ||
|
|
47def9efb3 | ||
|
|
c789510534 | ||
|
|
26fee3b1c0 | ||
|
|
bd14f818ab | ||
|
|
11d91f1305 | ||
|
|
473f4a0a97 | ||
|
|
e448b92074 | ||
|
|
00456139c4 | ||
|
|
3746407657 | ||
|
|
31683ce776 | ||
|
|
ea238834b6 | ||
|
|
8b9abf551d | ||
|
|
972145a0dc | ||
|
|
070d6149d1 | ||
|
|
b021a86330 | ||
|
|
a729aaa3bc | ||
|
|
820c615769 | ||
|
|
b9142ac6ce | ||
|
|
7dd1406f1b | ||
|
|
095a08e208 | ||
|
|
d39669c00b | ||
|
|
31f0cc2e4b | ||
|
|
c8e0529d81 | ||
|
|
6132f50d34 | ||
|
|
ea46bb0be3 | ||
|
|
5ba8191ff2 | ||
|
|
7b988d267b | ||
|
|
99372d2534 | ||
|
|
508bddc70a | ||
|
|
56d95b5414 | ||
|
|
71b9420286 | ||
|
|
024d64e0e0 | ||
|
|
e719f1af96 | ||
|
|
225aab1fed | ||
|
|
fde9e6870f | ||
|
|
90a9465caf | ||
|
|
37a61d79a6 | ||
|
|
cb2fce74a6 | ||
|
|
aaad122cff | ||
|
|
269a2e9ba9 | ||
|
|
d5b86bedd6 | ||
|
|
790f0fe7f9 | ||
|
|
8417144677 | ||
|
|
277f90e8b0 | ||
|
|
9306dc2015 | ||
|
|
e979b96923 | ||
|
|
5a362df491 | ||
|
|
1b611fef01 | ||
|
|
2f7d415cba | ||
|
|
5e992f6db9 | ||
|
|
844da0193a | ||
|
|
d42b44ee13 | ||
|
|
c3616ecb4d | ||
|
|
3a7787b1d7 | ||
|
|
47103a040f | ||
|
|
568140de4a | ||
|
|
6d2ade5f77 | ||
|
|
40427a2200 | ||
|
|
bb34cfb7d6 | ||
|
|
3fd840515b | ||
|
|
604a757665 | ||
|
|
107a3f4f11 | ||
|
|
f6fe53a44c | ||
|
|
7281c2d8ae | ||
|
|
bb8bc7f976 | ||
|
|
b4ae814567 | ||
|
|
b482396af9 | ||
|
|
9d9bf3c39b | ||
|
|
01fece902c | ||
|
|
663a145bd7 | ||
|
|
2417e49f9c | ||
|
|
b053ce70f9 | ||
|
|
a6f4588ef2 | ||
|
|
025df56796 | ||
|
|
f75f14141c | ||
|
|
f966d53f9e | ||
|
|
2c25fd3c08 | ||
|
|
e671d4429b | ||
|
|
95cf7bdeea | ||
|
|
7f96e0438e | ||
|
|
82006f812a | ||
|
|
951fb095fc | ||
|
|
06c1f0a7e9 | ||
|
|
4445989f85 | ||
|
|
c1156bb053 | ||
|
|
fc1a7908d6 | ||
|
|
70d427acea | ||
|
|
d299ae9af5 | ||
|
|
f79d7a65fd | ||
|
|
cff654b784 | ||
|
|
bdbd765e7e | ||
|
|
61bb2ee660 | ||
|
|
2472eef714 | ||
|
|
51c87609ae | ||
|
|
33c8ced3e9 | ||
|
|
94f1e43be7 | ||
|
|
13e09d2341 | ||
|
|
d3fc34752e | ||
|
|
f8ddecdf2f | ||
|
|
53a7025784 | ||
|
|
4f07522953 | ||
|
|
ad0c9adc03 | ||
|
|
16390ee4b6 | ||
|
|
ec8eee02fe | ||
|
|
db85f77b00 | ||
|
|
433fe5944c | ||
|
|
fb476e5022 | ||
|
|
29113b9398 | ||
|
|
fc0c8e898d | ||
|
|
fca9122052 | ||
|
|
f1e5cbf8fc | ||
|
|
2a6b25b840 | ||
|
|
1c9f4cfb5c | ||
|
|
4c7c2a4cd3 | ||
|
|
110c142a53 | ||
|
|
8c8f2019e9 | ||
|
|
e5557e0cde | ||
|
|
f4f7488d8a | ||
|
|
7ea27e7c28 | ||
|
|
b14b384777 | ||
|
|
7c284dc843 | ||
|
|
320e81f11b | ||
|
|
350f45ef76 | ||
|
|
20f7b444bb | ||
|
|
3da4b3a6d3 | ||
|
|
37a9f88983 | ||
|
|
d4c82dbd72 | ||
|
|
85e2b5eea0 | ||
|
|
e6cf4afc29 | ||
|
|
26ba12962c | ||
|
|
e963344f87 | ||
|
|
daf8658568 | ||
|
|
38394a6949 | ||
|
|
af34927930 | ||
|
|
fe4fbfca30 | ||
|
|
28de85f8f9 | ||
|
|
91817ea333 | ||
|
|
c285fc1cf7 | ||
|
|
45173f4063 | ||
|
|
c4271b30e9 | ||
|
|
c7205fa43d | ||
|
|
5ac65413f2 | ||
|
|
848c234e06 | ||
|
|
1b987ff2a5 | ||
|
|
8c0c80f6af | ||
|
|
8d3d80e603 | ||
|
|
3df22af3f0 | ||
|
|
199198ecb5 | ||
|
|
6180132486 | ||
|
|
7731e74c38 | ||
|
|
15f75a36b5 | ||
|
|
37eddc23fd | ||
|
|
7099dc3e51 | ||
|
|
cf1c7a319a | ||
|
|
eb68ef47b1 | ||
|
|
7f7fb23f32 | ||
|
|
846bc2ca35 | ||
|
|
ed77589a43 | ||
|
|
6ab94ce4e8 | ||
|
|
a5179907ad | ||
|
|
77bbf2afb5 | ||
|
|
85b95c5432 | ||
|
|
613a26cd1c | ||
|
|
18cc0fdaf3 | ||
|
|
39c0dfeb8f | ||
|
|
524ae68224 | ||
|
|
e63726d51c | ||
|
|
29c839602f | ||
|
|
1e20cad2ae | ||
|
|
7feeca8273 | ||
|
|
9c8d9ceb28 | ||
|
|
07a7035398 | ||
|
|
6c2f8a8f65 | ||
|
|
d1bf3c3be6 | ||
|
|
edef864ffc | ||
|
|
3effc265c4 | ||
|
|
41775bf8ef | ||
|
|
6c2464e399 | ||
|
|
17a7d04de9 | ||
|
|
b630c5b447 | ||
|
|
ab69b98766 | ||
|
|
41ac0f3b04 | ||
|
|
d78450137e | ||
|
|
1e47e28f20 | ||
|
|
80a8961878 | ||
|
|
95d555ef39 | ||
|
|
1a8f56f3d1 | ||
|
|
4e1059740a | ||
|
|
7e225d60fd | ||
|
|
b55449b739 | ||
|
|
5b298cf43c | ||
|
|
b56fe48277 | ||
|
|
4c438de595 | ||
|
|
ea006f1d77 | ||
|
|
cb4e0a9e75 | ||
|
|
7df32ba4cd | ||
|
|
89098b3726 | ||
|
|
9e45c2ac4d | ||
|
|
d4f8f833a2 | ||
|
|
e159254cd2 | ||
|
|
ee090149b9 | ||
|
|
a22c8c1d8e | ||
|
|
83ff45ce04 | ||
|
|
815e650448 | ||
|
|
777bdc908f | ||
|
|
45231b69a7 | ||
|
|
b01f522ace | ||
|
|
e840766b1f | ||
|
|
4298916013 | ||
|
|
788bdfb29b | ||
|
|
3ec8672a75 | ||
|
|
fc95067193 | ||
|
|
d14867f785 | ||
|
|
ffe483ae2d | ||
|
|
dc2d71489d | ||
|
|
42402ee6f4 | ||
|
|
f4f95cd096 | ||
|
|
dafea0cad6 | ||
|
|
b5fe63af22 | ||
|
|
a48ace4d70 | ||
|
|
5440688dd9 | ||
|
|
b21b548b9c | ||
|
|
fe44483e60 | ||
|
|
12be32f6dc | ||
|
|
524080b0ae | ||
|
|
d8dfc1ca0b | ||
|
|
bee7c077b7 | ||
|
|
a3abc0296d | ||
|
|
2d3580e2d4 | ||
|
|
3c5fcebce9 | ||
|
|
00bb2de032 | ||
|
|
013af68d74 | ||
|
|
8209c74918 | ||
|
|
4ed2c4e5a8 | ||
|
|
34e125ea80 | ||
|
|
135071b3aa | ||
|
|
38952e5b3d | ||
|
|
3eefe2438b | ||
|
|
faaf20de95 | ||
|
|
7d5cedc6eb | ||
|
|
51efc3c184 | ||
|
|
cddba23dcf | ||
|
|
5c693246ba | ||
|
|
ae0aa61b3c | ||
|
|
1cf10f1f11 | ||
|
|
b576703533 | ||
|
|
850de683db | ||
|
|
59fd461563 | ||
|
|
ddd93df503 | ||
|
|
74f98f9eb2 | ||
|
|
b32d50df2d | ||
|
|
61d1c498ef | ||
|
|
7bbc618e1b | ||
|
|
865371b58f | ||
|
|
16b1f88546 | ||
|
|
0f43e2b6f2 | ||
|
|
949ecf60d9 | ||
|
|
0024162121 | ||
|
|
958471b081 | ||
|
|
de80133ea2 | ||
|
|
13104750f6 | ||
|
|
2f575af3d2 | ||
|
|
56f99ed640 | ||
|
|
a42e7f226f | ||
|
|
d6e513f6c3 | ||
|
|
1500fff93e | ||
|
|
c37437e82b | ||
|
|
7d0bb05aaa | ||
|
|
35297a149d | ||
|
|
e68b71ba01 | ||
|
|
900be13423 | ||
|
|
02b8cc7ad3 | ||
|
|
0371c53d07 | ||
|
|
364a54f792 | ||
|
|
0016bd8744 | ||
|
|
36baf38d09 | ||
|
|
437244f61e | ||
|
|
70c85af7e2 | ||
|
|
d97dbdac36 | ||
|
|
89013c8f6e | ||
|
|
ff80f613d3 | ||
|
|
15cbddba13 | ||
|
|
7c11bd2214 | ||
|
|
7280eb3cd9 | ||
|
|
4d38c1f95d | ||
|
|
8d196500d8 | ||
|
|
a0e21c8bf6 | ||
|
|
6b85ff0d77 | ||
|
|
89b622e6a0 | ||
|
|
53e2e352fd | ||
|
|
fda48fc537 | ||
|
|
3d8721246a | ||
|
|
0b3847eb5d | ||
|
|
96606fe3da | ||
|
|
b061288d1c | ||
|
|
89080af339 | ||
|
|
7bfe51c925 | ||
|
|
07b43f11e2 | ||
|
|
8b4fe15aeb | ||
|
|
95486ef962 | ||
|
|
5a799d4c33 | ||
|
|
5da2fad0a2 | ||
|
|
6c84520021 | ||
|
|
2955c814b3 | ||
|
|
aad3b77996 | ||
|
|
109191f248 | ||
|
|
749130b689 | ||
|
|
a8732aa83c | ||
|
|
6b9aa49f79 | ||
|
|
50b701ccf0 | ||
|
|
7a67217c87 | ||
|
|
4f861dcbec | ||
|
|
4be5d27ada | ||
|
|
71b0ffa3ca | ||
|
|
7ff35067aa | ||
|
|
05ee844bf6 | ||
|
|
d05a139a5f | ||
|
|
b8da04814b | ||
|
|
5482a80fe3 | ||
|
|
2fd2812c94 | ||
|
|
bd0cd93c90 | ||
|
|
90efb232a4 | ||
|
|
431bf08c83 | ||
|
|
d6a70fb31e | ||
|
|
a049cfefe8 | ||
|
|
88725f68dd | ||
|
|
e07aefdcfd | ||
|
|
878b724ce1 | ||
|
|
d0bcb6b6aa | ||
|
|
e6489b3bc1 | ||
|
|
aebc473071 | ||
|
|
fdf43f058a | ||
|
|
6886510e32 | ||
|
|
dafa2e3401 | ||
|
|
e67d37e9d8 | ||
|
|
9422542635 | ||
|
|
f5bed87eec | ||
|
|
7d2f0fd5cf | ||
|
|
cfd8770499 | ||
|
|
a540e9a0da | ||
|
|
028059a668 | ||
|
|
1031d6b6f5 | ||
|
|
c6a0243c92 | ||
|
|
9736f56d3b | ||
|
|
662d50eeea | ||
|
|
bfbbd5375f | ||
|
|
b735106750 | ||
|
|
1857c0c0b4 | ||
|
|
157bb84bce | ||
|
|
52617e6ef1 | ||
|
|
239816f4f5 | ||
|
|
e4ee88a492 | ||
|
|
353958538c | ||
|
|
47a91ccf33 | ||
|
|
85baeeb34e | ||
|
|
ef1c8199a5 | ||
|
|
89da594735 | ||
|
|
811085f9bd | ||
|
|
b8904bc018 | ||
|
|
937d234964 | ||
|
|
b5bc4f15f8 | ||
|
|
16863f2ed1 | ||
|
|
805afbb592 | ||
|
|
977b61f91c | ||
|
|
91815c65a3 | ||
|
|
13cb6f481f | ||
|
|
dc254ff0f7 | ||
|
|
a633241d2f | ||
|
|
97b38f4ccd | ||
|
|
416e4948d7 | ||
|
|
60dff589d4 | ||
|
|
61656c6eba | ||
|
|
2affc4d847 | ||
|
|
09179159e7 | ||
|
|
b43dc8348d | ||
|
|
f3357c2b5b | ||
|
|
79c308166a | ||
|
|
2ea985fd30 | ||
|
|
385cfd5161 | ||
|
|
db3cd543df | ||
|
|
e139fadb02 | ||
|
|
10809b47ad | ||
|
|
dd449ffed0 | ||
|
|
1f5124fc8a | ||
|
|
741a251d89 | ||
|
|
1012611785 | ||
|
|
465f828d73 | ||
|
|
038294d5c1 | ||
|
|
d1b33e1638 | ||
|
|
d863a4b143 | ||
|
|
4a073b6e46 | ||
|
|
30b0c35442 | ||
|
|
ef5bb6d447 | ||
|
|
6aa0c7ca39 | ||
|
|
70b3091097 | ||
|
|
210a79a575 | ||
|
|
a4fb4fd530 | ||
|
|
6f56320177 | ||
|
|
4d13b5105e | ||
|
|
97a398790f | ||
|
|
c09da5cac8 | ||
|
|
9521e71840 | ||
|
|
e5d09e1b04 | ||
|
|
ebe6d5c5c1 | ||
|
|
0320884c72 | ||
|
|
a254d2120d | ||
|
|
4157907358 | ||
|
|
dfc8708808 | ||
|
|
67c40eb212 | ||
|
|
bafaef7060 | ||
|
|
ee06eda05c | ||
|
|
a3525dd073 | ||
|
|
f97f0e4e1b | ||
|
|
c62e93577b | ||
|
|
bcebd3fb83 | ||
|
|
0589c82242 | ||
|
|
4ddf4d1c99 | ||
|
|
a98148f19b | ||
|
|
d1072e8942 | ||
|
|
5b0254f0c7 | ||
|
|
c2b406e7d6 | ||
|
|
4821290c32 | ||
|
|
d3bb68c2b0 | ||
|
|
9560364a1c | ||
|
|
4b49bc7140 | ||
|
|
88bac57cad | ||
|
|
9630921d91 | ||
|
|
84e216c2ac | ||
|
|
0bc72e908f | ||
|
|
6910572bd2 | ||
|
|
a4dd8a38b3 | ||
|
|
f0b4127567 | ||
|
|
c4f3a4e68e | ||
|
|
c0aa4289e2 | ||
|
|
9be600cffe | ||
|
|
c998f6eb53 | ||
|
|
c901b38858 | ||
|
|
4bd09cf14b | ||
|
|
3edadb01c5 | ||
|
|
b738764442 | ||
|
|
660fd94e7f | ||
|
|
a3138b8514 | ||
|
|
627e434b73 | ||
|
|
406754f31b | ||
|
|
b371521b33 | ||
|
|
f151933d91 | ||
|
|
5ea93822e7 | ||
|
|
cafd2d80d2 | ||
|
|
c9dcd7973a |
No files matched your search
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
+1
-5
@@ -169,11 +169,7 @@ public class AdapterDeploymentContext {
|
|||||||
public void setAuthServerBaseUrl(String authServerBaseUrl) {
|
public void setAuthServerBaseUrl(String authServerBaseUrl) {
|
||||||
this.authServerBaseUrl = authServerBaseUrl;
|
this.authServerBaseUrl = authServerBaseUrl;
|
||||||
KeycloakUriBuilder serverBuilder = KeycloakUriBuilder.fromUri(authServerBaseUrl);
|
KeycloakUriBuilder serverBuilder = KeycloakUriBuilder.fromUri(authServerBaseUrl);
|
||||||
resolveBrowserUrls(serverBuilder);
|
resolveUrls(serverBuilder);
|
||||||
|
|
||||||
if (delegate.getRelativeUrls() == RelativeUrlsUsed.ALL_REQUESTS) {
|
|
||||||
resolveNonBrowserUrls(serverBuilder);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -38,37 +38,6 @@ public class AdapterUtils {
|
|||||||
return UUID.randomUUID().toString();
|
return UUID.randomUUID().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Best effort to find origin for REST request calls from web UI application to REST application. In case of relative or absolute
|
|
||||||
* "auth-server-url" is returned the URL from request. In case of "auth-server-url-for-backend-request" used in configuration, it returns
|
|
||||||
* the origin of auth server.
|
|
||||||
*
|
|
||||||
* This may be the optimization in cluster, so if you have keycloak and applications on same host, the REST request doesn't need to
|
|
||||||
* go through loadbalancer, but can be sent directly to same host.
|
|
||||||
*
|
|
||||||
* @param browserRequestURL
|
|
||||||
* @param session
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static String getOriginForRestCalls(String browserRequestURL, KeycloakSecurityContext session) {
|
|
||||||
if (session instanceof RefreshableKeycloakSecurityContext) {
|
|
||||||
KeycloakDeployment deployment = ((RefreshableKeycloakSecurityContext)session).getDeployment();
|
|
||||||
switch (deployment.getRelativeUrls()) {
|
|
||||||
case ALL_REQUESTS:
|
|
||||||
case NEVER:
|
|
||||||
// Resolve baseURI from the request
|
|
||||||
return UriUtils.getOrigin(browserRequestURL);
|
|
||||||
case BROWSER_ONLY:
|
|
||||||
// Resolve baseURI from the codeURL (This is already non-relative and based on our hostname)
|
|
||||||
return UriUtils.getOrigin(deployment.getTokenUrl());
|
|
||||||
default:
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return UriUtils.getOrigin(browserRequestURL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Set<String> getRolesFromSecurityContext(RefreshableKeycloakSecurityContext session) {
|
public static Set<String> getRolesFromSecurityContext(RefreshableKeycloakSecurityContext session) {
|
||||||
Set<String> roles = null;
|
Set<String> roles = null;
|
||||||
AccessToken accessToken = session.getToken();
|
AccessToken accessToken = session.getToken();
|
||||||
|
|||||||
+2
@@ -24,6 +24,7 @@ import org.apache.http.client.HttpClient;
|
|||||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||||
import org.apache.http.client.methods.HttpPost;
|
import org.apache.http.client.methods.HttpPost;
|
||||||
import org.apache.http.message.BasicNameValuePair;
|
import org.apache.http.message.BasicNameValuePair;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
import org.keycloak.OAuth2Constants;
|
import org.keycloak.OAuth2Constants;
|
||||||
import org.keycloak.adapters.authentication.ClientCredentialsProviderUtils;
|
import org.keycloak.adapters.authentication.ClientCredentialsProviderUtils;
|
||||||
@@ -104,6 +105,7 @@ public class BasicAuthRequestAuthenticator extends BearerTokenRequestAuthenticat
|
|||||||
int status = response.getStatusLine().getStatusCode();
|
int status = response.getStatusLine().getStatusCode();
|
||||||
HttpEntity entity = response.getEntity();
|
HttpEntity entity = response.getEntity();
|
||||||
if (status != 200) {
|
if (status != 200) {
|
||||||
|
EntityUtils.consumeQuietly(entity);
|
||||||
throw new java.io.IOException("Bad status: " + status);
|
throw new java.io.IOException("Bad status: " + status);
|
||||||
}
|
}
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
|
|||||||
+7
-38
@@ -111,39 +111,17 @@ public class KeycloakDeployment {
|
|||||||
|
|
||||||
public void setAuthServerBaseUrl(AdapterConfig config) {
|
public void setAuthServerBaseUrl(AdapterConfig config) {
|
||||||
this.authServerBaseUrl = config.getAuthServerUrl();
|
this.authServerBaseUrl = config.getAuthServerUrl();
|
||||||
String authServerURLForBackendReqs = config.getAuthServerUrlForBackendRequests();
|
if (authServerBaseUrl == null) return;
|
||||||
if (authServerBaseUrl == null && authServerURLForBackendReqs == null) return;
|
|
||||||
|
|
||||||
URI authServerUri = null;
|
URI authServerUri = URI.create(authServerBaseUrl);
|
||||||
if (authServerBaseUrl != null) {
|
|
||||||
authServerUri = URI.create(authServerBaseUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (authServerUri == null || authServerUri.getHost() == null) {
|
if (authServerUri.getHost() == null) {
|
||||||
if (authServerURLForBackendReqs != null) {
|
relativeUrls = RelativeUrlsUsed.ALWAYS;
|
||||||
relativeUrls = RelativeUrlsUsed.BROWSER_ONLY;
|
|
||||||
|
|
||||||
KeycloakUriBuilder serverBuilder = KeycloakUriBuilder.fromUri(authServerURLForBackendReqs);
|
|
||||||
if (serverBuilder.getHost() == null || serverBuilder.getScheme() == null) {
|
|
||||||
throw new IllegalStateException("Relative URL not supported for auth-server-url-for-backend-requests option. URL used: "
|
|
||||||
+ authServerURLForBackendReqs + ", Client: " + config.getResource());
|
|
||||||
}
|
|
||||||
resolveNonBrowserUrls(serverBuilder);
|
|
||||||
} else {
|
|
||||||
relativeUrls = RelativeUrlsUsed.ALL_REQUESTS;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// We have absolute URI in config
|
// We have absolute URI in config
|
||||||
relativeUrls = RelativeUrlsUsed.NEVER;
|
relativeUrls = RelativeUrlsUsed.NEVER;
|
||||||
KeycloakUriBuilder serverBuilder = KeycloakUriBuilder.fromUri(authServerBaseUrl);
|
KeycloakUriBuilder serverBuilder = KeycloakUriBuilder.fromUri(authServerBaseUrl);
|
||||||
resolveBrowserUrls(serverBuilder);
|
resolveUrls(serverBuilder);
|
||||||
|
|
||||||
if (authServerURLForBackendReqs == null) {
|
|
||||||
resolveNonBrowserUrls(serverBuilder);
|
|
||||||
} else {
|
|
||||||
serverBuilder = KeycloakUriBuilder.fromUri(authServerURLForBackendReqs);
|
|
||||||
resolveNonBrowserUrls(serverBuilder);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,23 +130,14 @@ public class KeycloakDeployment {
|
|||||||
/**
|
/**
|
||||||
* @param authUrlBuilder absolute URI
|
* @param authUrlBuilder absolute URI
|
||||||
*/
|
*/
|
||||||
protected void resolveBrowserUrls(KeycloakUriBuilder authUrlBuilder) {
|
protected void resolveUrls(KeycloakUriBuilder authUrlBuilder) {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("resolveBrowserUrls");
|
log.debug("resolveUrls");
|
||||||
}
|
}
|
||||||
|
|
||||||
String login = authUrlBuilder.clone().path(ServiceUrlConstants.AUTH_PATH).build(getRealm()).toString();
|
String login = authUrlBuilder.clone().path(ServiceUrlConstants.AUTH_PATH).build(getRealm()).toString();
|
||||||
authUrl = KeycloakUriBuilder.fromUri(login);
|
authUrl = KeycloakUriBuilder.fromUri(login);
|
||||||
realmInfoUrl = authUrlBuilder.clone().path(ServiceUrlConstants.REALM_INFO_PATH).build(getRealm()).toString();
|
realmInfoUrl = authUrlBuilder.clone().path(ServiceUrlConstants.REALM_INFO_PATH).build(getRealm()).toString();
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param authUrlBuilder absolute URI
|
|
||||||
*/
|
|
||||||
protected void resolveNonBrowserUrls(KeycloakUriBuilder authUrlBuilder) {
|
|
||||||
if (log.isDebugEnabled()) {
|
|
||||||
log.debug("resolveNonBrowserUrls");
|
|
||||||
}
|
|
||||||
|
|
||||||
tokenUrl = authUrlBuilder.clone().path(ServiceUrlConstants.TOKEN_PATH).build(getRealm()).toString();
|
tokenUrl = authUrlBuilder.clone().path(ServiceUrlConstants.TOKEN_PATH).build(getRealm()).toString();
|
||||||
logoutUrl = KeycloakUriBuilder.fromUri(authUrlBuilder.clone().path(ServiceUrlConstants.TOKEN_SERVICE_LOGOUT_PATH).build(getRealm()).toString());
|
logoutUrl = KeycloakUriBuilder.fromUri(authUrlBuilder.clone().path(ServiceUrlConstants.TOKEN_SERVICE_LOGOUT_PATH).build(getRealm()).toString());
|
||||||
|
|||||||
+1
-1
@@ -54,7 +54,7 @@ public class KeycloakDeploymentBuilderTest {
|
|||||||
assertEquals("234234-234234-234234", deployment.getResourceCredentials().get("secret"));
|
assertEquals("234234-234234-234234", deployment.getResourceCredentials().get("secret"));
|
||||||
assertEquals(ClientIdAndSecretCredentialsProvider.PROVIDER_ID, deployment.getClientAuthenticator().getId());
|
assertEquals(ClientIdAndSecretCredentialsProvider.PROVIDER_ID, deployment.getClientAuthenticator().getId());
|
||||||
assertEquals(20, ((ThreadSafeClientConnManager) deployment.getClient().getConnectionManager()).getMaxTotal());
|
assertEquals(20, ((ThreadSafeClientConnManager) deployment.getClient().getConnectionManager()).getMaxTotal());
|
||||||
assertEquals("https://backend:8443/auth/realms/demo/protocol/openid-connect/token", deployment.getTokenUrl());
|
assertEquals("https://localhost:8443/auth/realms/demo/protocol/openid-connect/token", deployment.getTokenUrl());
|
||||||
assertEquals(RelativeUrlsUsed.NEVER, deployment.getRelativeUrls());
|
assertEquals(RelativeUrlsUsed.NEVER, deployment.getRelativeUrls());
|
||||||
assertTrue(deployment.isAlwaysRefreshToken());
|
assertTrue(deployment.isAlwaysRefreshToken());
|
||||||
assertTrue(deployment.isRegisterNodeAtStartup());
|
assertTrue(deployment.isRegisterNodeAtStartup());
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
"client-keystore": "classpath:/keystore.jks",
|
"client-keystore": "classpath:/keystore.jks",
|
||||||
"client-keystore-password": "storepass",
|
"client-keystore-password": "storepass",
|
||||||
"client-key-password": "keypass",
|
"client-key-password": "keypass",
|
||||||
"auth-server-url-for-backend-requests": "https://backend:8443/auth",
|
|
||||||
"always-refresh-token": true,
|
"always-refresh-token": true,
|
||||||
"register-node-at-startup": true,
|
"register-node-at-startup": true,
|
||||||
"register-node-period": 1000,
|
"register-node-period": 1000,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-as7-integration-pom</artifactId>
|
<artifactId>keycloak-as7-integration-pom</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-as7-integration-pom</artifactId>
|
<artifactId>keycloak-as7-integration-pom</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-as7-integration-pom</artifactId>
|
<artifactId>keycloak-as7-integration-pom</artifactId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<name>Keycloak AS7 / JBoss EAP 6 Integration</name>
|
<name>Keycloak AS7 / JBoss EAP 6 Integration</name>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../../pom.xml</relativePath>
|
<relativePath>../../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../../pom.xml</relativePath>
|
<relativePath>../../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../../pom.xml</relativePath>
|
<relativePath>../../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../../pom.xml</relativePath>
|
<relativePath>../../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<name>Keycloak Jetty Integration</name>
|
<name>Keycloak Jetty Integration</name>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
var kc = this;
|
var kc = this;
|
||||||
var adapter;
|
var adapter;
|
||||||
var refreshQueue = [];
|
var refreshQueue = [];
|
||||||
|
var storage;
|
||||||
|
|
||||||
var loginIframe = {
|
var loginIframe = {
|
||||||
enable: true,
|
enable: true,
|
||||||
@@ -35,6 +36,8 @@
|
|||||||
kc.init = function (initOptions) {
|
kc.init = function (initOptions) {
|
||||||
kc.authenticated = false;
|
kc.authenticated = false;
|
||||||
|
|
||||||
|
storage = new PersistentStorage();
|
||||||
|
|
||||||
if (window.Cordova) {
|
if (window.Cordova) {
|
||||||
adapter = loadAdapter('cordova');
|
adapter = loadAdapter('cordova');
|
||||||
} else {
|
} else {
|
||||||
@@ -163,6 +166,8 @@
|
|||||||
}
|
}
|
||||||
} else if (initOptions.onLoad) {
|
} else if (initOptions.onLoad) {
|
||||||
onLoad();
|
onLoad();
|
||||||
|
} else {
|
||||||
|
initPromise.setSuccess();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
initPromise.setSuccess();
|
initPromise.setSuccess();
|
||||||
@@ -190,7 +195,7 @@
|
|||||||
redirectUri += (redirectUri.indexOf('?') == -1 ? '?' : '&') + 'prompt=' + options.prompt;
|
redirectUri += (redirectUri.indexOf('?') == -1 ? '?' : '&') + 'prompt=' + options.prompt;
|
||||||
}
|
}
|
||||||
|
|
||||||
sessionStorage.oauthState = JSON.stringify({ state: state, nonce: nonce, redirectUri: encodeURIComponent(redirectUri) });
|
storage.setItem('oauthState', JSON.stringify({ state: state, nonce: nonce, redirectUri: encodeURIComponent(redirectUri) }));
|
||||||
|
|
||||||
var action = 'auth';
|
var action = 'auth';
|
||||||
if (options && options.action == 'register') {
|
if (options && options.action == 'register') {
|
||||||
@@ -687,10 +692,11 @@
|
|||||||
function parseCallback(url) {
|
function parseCallback(url) {
|
||||||
var oauth = new CallbackParser(url, kc.responseMode).parseUri();
|
var oauth = new CallbackParser(url, kc.responseMode).parseUri();
|
||||||
|
|
||||||
var sessionState = sessionStorage.oauthState && JSON.parse(sessionStorage.oauthState);
|
var oauthState = storage.getItem('oauthState');
|
||||||
|
var sessionState = oauthState && JSON.parse(oauthState);
|
||||||
|
|
||||||
if (sessionState && (oauth.code || oauth.error || oauth.access_token || oauth.id_token) && oauth.state && oauth.state == sessionState.state) {
|
if (sessionState && (oauth.code || oauth.error || oauth.access_token || oauth.id_token) && oauth.state && oauth.state == sessionState.state) {
|
||||||
delete sessionStorage.oauthState;
|
storage.removeItem('oauthState');
|
||||||
|
|
||||||
oauth.redirectUri = sessionState.redirectUri;
|
oauth.redirectUri = sessionState.redirectUri;
|
||||||
oauth.storedNonce = sessionState.nonce;
|
oauth.storedNonce = sessionState.nonce;
|
||||||
@@ -971,6 +977,82 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var PersistentStorage = function() {
|
||||||
|
if (!(this instanceof PersistentStorage)) {
|
||||||
|
return new PersistentStorage();
|
||||||
|
}
|
||||||
|
var ps = this;
|
||||||
|
var useCookieStorage = function () {
|
||||||
|
if (typeof localStorage === "undefined") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
var key = '@@keycloak-session-storage/test';
|
||||||
|
localStorage.setItem(key, 'test');
|
||||||
|
localStorage.removeItem(key);
|
||||||
|
return false;
|
||||||
|
} catch (err) {
|
||||||
|
// Probably in Safari "private mode" where localStorage
|
||||||
|
// quota is 0, or quota exceeded. Switching to cookie
|
||||||
|
// storage.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ps.setItem = function(key, value) {
|
||||||
|
if (useCookieStorage()) {
|
||||||
|
setCookie(key, value, cookieExpiration(5));
|
||||||
|
} else {
|
||||||
|
localStorage.setItem(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ps.getItem = function(key) {
|
||||||
|
if (useCookieStorage()) {
|
||||||
|
return getCookie(key);
|
||||||
|
}
|
||||||
|
return localStorage.getItem(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
ps.removeItem = function(key) {
|
||||||
|
if (typeof localStorage !== "undefined") {
|
||||||
|
try {
|
||||||
|
// Always try to delete from localStorage.
|
||||||
|
localStorage.removeItem(key);
|
||||||
|
} catch (err) { }
|
||||||
|
}
|
||||||
|
// Always remove the cookie.
|
||||||
|
setCookie(key, '', cookieExpiration(-100));
|
||||||
|
}
|
||||||
|
|
||||||
|
var cookieExpiration = function (minutes) {
|
||||||
|
var exp = new Date();
|
||||||
|
exp.setTime(exp.getTime() + (minutes*60*1000));
|
||||||
|
return exp;
|
||||||
|
}
|
||||||
|
|
||||||
|
var getCookie = function (key) {
|
||||||
|
var name = key + '=';
|
||||||
|
var ca = document.cookie.split(';');
|
||||||
|
for (var i = 0; i < ca.length; i++) {
|
||||||
|
var c = ca[i];
|
||||||
|
while (c.charAt(0) == ' ') {
|
||||||
|
c = c.substring(1);
|
||||||
|
}
|
||||||
|
if (c.indexOf(name) == 0) {
|
||||||
|
return c.substring(name.length, c.length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
var setCookie = function (key, value, expirationDate) {
|
||||||
|
var cookie = key + '=' + value + '; '
|
||||||
|
+ 'expires=' + expirationDate.toUTCString() + '; ';
|
||||||
|
document.cookie = cookie;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var CallbackParser = function(uriToParse, responseMode) {
|
var CallbackParser = function(uriToParse, responseMode) {
|
||||||
if (!(this instanceof CallbackParser)) {
|
if (!(this instanceof CallbackParser)) {
|
||||||
return new CallbackParser(uriToParse, responseMode);
|
return new CallbackParser(uriToParse, responseMode);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -36,15 +36,32 @@
|
|||||||
org.keycloak.adapters.osgi.*
|
org.keycloak.adapters.osgi.*
|
||||||
</keycloak.osgi.export>
|
</keycloak.osgi.export>
|
||||||
<keycloak.osgi.import>
|
<keycloak.osgi.import>
|
||||||
org.ops4j.pax.web.*;version="[3.0,4)",
|
org.ops4j.pax.web.*;version="[3.0,5)",
|
||||||
javax.servlet.*;version="[2.5,4)";resolution:=optional,
|
javax.servlet.*;version="[2.5,4)";resolution:=optional,
|
||||||
org.eclipse.jetty.*;version="[8.1,10)";resolution:=optional,
|
org.eclipse.jetty.*;version="[8.1,10)";resolution:=optional,
|
||||||
org.keycloak.*;version="${project.version}",
|
org.keycloak.*;version="${project.version}",
|
||||||
|
org.apache.cxf.transport.http;resolution:=optional;version="[3,4)",
|
||||||
|
org.apache.cxf.transport.servlet;resolution:=optional;version="[3,4)",
|
||||||
*;resolution:=optional
|
*;resolution:=optional
|
||||||
</keycloak.osgi.import>
|
</keycloak.osgi.import>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-core</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-adapter-core</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-adapter-spi</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jboss.logging</groupId>
|
<groupId>org.jboss.logging</groupId>
|
||||||
<artifactId>jboss-logging</artifactId>
|
<artifactId>jboss-logging</artifactId>
|
||||||
@@ -65,12 +82,23 @@
|
|||||||
<artifactId>pax-web-runtime</artifactId>
|
<artifactId>pax-web-runtime</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.ops4j.pax.web</groupId>
|
||||||
|
<artifactId>pax-web-api</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>jetty-security</artifactId>
|
<artifactId>jetty-security</artifactId>
|
||||||
<version>${jetty9.version}</version>
|
<version>${jetty9.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.cxf</groupId>
|
||||||
|
<artifactId>cxf-rt-transports-http</artifactId>
|
||||||
|
<version>${cxf.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
+71
@@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||||
|
* and other contributors as indicated by the @author tags.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.keycloak.adapters.osgi;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
import org.keycloak.adapters.KeycloakConfigResolver;
|
||||||
|
import org.keycloak.adapters.KeycloakDeployment;
|
||||||
|
import org.keycloak.adapters.KeycloakDeploymentBuilder;
|
||||||
|
import org.keycloak.adapters.OIDCHttpFacade;
|
||||||
|
|
||||||
|
public class PathBasedKeycloakConfigResolver implements KeycloakConfigResolver {
|
||||||
|
|
||||||
|
private final Map<String, KeycloakDeployment> cache = new ConcurrentHashMap<String, KeycloakDeployment>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public KeycloakDeployment resolve(OIDCHttpFacade.Request request) {
|
||||||
|
String path = request.getURI();
|
||||||
|
String[] urlTokens = path.split("/");
|
||||||
|
if (urlTokens.length < 4) {
|
||||||
|
throw new IllegalStateException("Not able to determine the web-context to load the correspondent keycloak.json file");
|
||||||
|
}
|
||||||
|
|
||||||
|
String webContext = urlTokens[3];
|
||||||
|
|
||||||
|
KeycloakDeployment deployment = cache.get(webContext);
|
||||||
|
if (null == deployment) {
|
||||||
|
// not found on the simple cache, try to load it from the file system
|
||||||
|
String keycloakConfig = (String) System.getProperties().get("keycloak.config");
|
||||||
|
if(keycloakConfig == null || "".equals(keycloakConfig.trim())){
|
||||||
|
String karafEtc = (String) System.getProperties().get("karaf.etc");
|
||||||
|
if(karafEtc == null || "".equals(karafEtc.trim())){
|
||||||
|
throw new IllegalStateException("Neither \"keycloak.config\" nor \"karaf.etc\" java properties are set. Please set one of them.");
|
||||||
|
}
|
||||||
|
keycloakConfig = karafEtc;
|
||||||
|
}
|
||||||
|
|
||||||
|
String absolutePath = keycloakConfig + File.separator + webContext + "-keycloak.json";
|
||||||
|
InputStream is = null;
|
||||||
|
try {
|
||||||
|
is = new FileInputStream(absolutePath);
|
||||||
|
} catch (FileNotFoundException e){
|
||||||
|
throw new IllegalStateException("Not able to find the file " + absolutePath);
|
||||||
|
}
|
||||||
|
deployment = KeycloakDeploymentBuilder.build(is);
|
||||||
|
cache.put(webContext, deployment);
|
||||||
|
}
|
||||||
|
|
||||||
|
return deployment;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+113
-27
@@ -18,15 +18,22 @@
|
|||||||
package org.keycloak.adapters.osgi;
|
package org.keycloak.adapters.osgi;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Dictionary;
|
||||||
|
import java.util.Enumeration;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
import javax.servlet.Servlet;
|
import javax.servlet.Servlet;
|
||||||
|
|
||||||
|
import org.apache.cxf.transport.http.DestinationRegistry;
|
||||||
|
import org.apache.cxf.transport.servlet.CXFNonSpringServlet;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
import org.ops4j.pax.web.service.WebContainer;
|
import org.ops4j.pax.web.service.WebContainer;
|
||||||
import org.osgi.framework.BundleContext;
|
import org.osgi.framework.BundleContext;
|
||||||
import org.osgi.framework.ServiceReference;
|
import org.osgi.framework.ServiceReference;
|
||||||
|
import org.osgi.service.cm.Configuration;
|
||||||
|
import org.osgi.service.cm.ConfigurationAdmin;
|
||||||
import org.osgi.service.http.HttpContext;
|
import org.osgi.service.http.HttpContext;
|
||||||
import org.osgi.util.tracker.ServiceTracker;
|
import org.osgi.util.tracker.ServiceTracker;
|
||||||
import org.osgi.util.tracker.ServiceTrackerCustomizer;
|
import org.osgi.util.tracker.ServiceTrackerCustomizer;
|
||||||
@@ -42,13 +49,15 @@ import org.osgi.util.tracker.ServiceTrackerCustomizer;
|
|||||||
*/
|
*/
|
||||||
public class ServletReregistrationService {
|
public class ServletReregistrationService {
|
||||||
|
|
||||||
|
private static final String CXF_SERVLET_PREFIX = "org.apache.cxf.servlet.";
|
||||||
protected static final Logger log = Logger.getLogger(ServletReregistrationService.class);
|
protected static final Logger log = Logger.getLogger(ServletReregistrationService.class);
|
||||||
|
|
||||||
private static final List<String> FILTERED_PROPERTIES = Arrays.asList("objectClass", "service.id");
|
private static final List<String> FILTERED_PROPERTIES = Arrays.asList("objectClass", "service.id");
|
||||||
|
|
||||||
private BundleContext bundleContext;
|
private BundleContext bundleContext;
|
||||||
private ServiceReference servletReference;
|
private ServiceReference managedServiceReference;
|
||||||
private ServiceTracker webContainerTracker;
|
private ServiceTracker webContainerTracker;
|
||||||
|
private String alias;
|
||||||
|
|
||||||
public BundleContext getBundleContext() {
|
public BundleContext getBundleContext() {
|
||||||
return bundleContext;
|
return bundleContext;
|
||||||
@@ -58,24 +67,18 @@ public class ServletReregistrationService {
|
|||||||
this.bundleContext = bundleContext;
|
this.bundleContext = bundleContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServiceReference getServletReference() {
|
|
||||||
return servletReference;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setServletReference(ServiceReference servletReference) {
|
|
||||||
this.servletReference = servletReference;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected ServiceTracker getWebContainerTracker() {
|
|
||||||
return webContainerTracker;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void start() {
|
public void start() {
|
||||||
if (servletReference == null) {
|
if ( managedServiceReference == null) {
|
||||||
throw new IllegalStateException("No servlet reference provided");
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Dictionary properties = obtainProperties();
|
||||||
|
alias = (String)getProp(properties, CXF_SERVLET_PREFIX + "context", "/cxf");
|
||||||
|
if(alias == null){
|
||||||
|
alias = "/cxf";
|
||||||
}
|
}
|
||||||
|
|
||||||
final Servlet servlet = (Servlet) bundleContext.getService(servletReference);
|
|
||||||
WebContainer externalWebContainer = findExternalWebContainer();
|
WebContainer externalWebContainer = findExternalWebContainer();
|
||||||
if (externalWebContainer == null) {
|
if (externalWebContainer == null) {
|
||||||
return;
|
return;
|
||||||
@@ -83,18 +86,19 @@ public class ServletReregistrationService {
|
|||||||
|
|
||||||
// Unregister servlet from external container now
|
// Unregister servlet from external container now
|
||||||
try {
|
try {
|
||||||
externalWebContainer.unregisterServlet(servlet);
|
externalWebContainer.unregister(alias);
|
||||||
log.debug("Original servlet with alias " + getAlias() + " unregistered successfully from external web container.");
|
log.debug("Original servlet with alias " + getAlias() + " unregistered successfully from external web container.");
|
||||||
} catch (IllegalStateException e) {
|
} catch (IllegalStateException e) {
|
||||||
log.warn("Can't unregister servlet due to: " + e.getMessage());
|
log.warn("Can't unregister servlet due to: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final Dictionary finalProperties = properties;
|
||||||
ServiceTrackerCustomizer trackerCustomizer = new ServiceTrackerCustomizer() {
|
ServiceTrackerCustomizer trackerCustomizer = new ServiceTrackerCustomizer() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object addingService(ServiceReference webContainerServiceReference) {
|
public Object addingService(ServiceReference webContainerServiceReference) {
|
||||||
WebContainer ourWebContainer = (WebContainer) bundleContext.getService(webContainerServiceReference);
|
WebContainer ourWebContainer = (WebContainer) bundleContext.getService(webContainerServiceReference);
|
||||||
registerServlet(ourWebContainer, servlet);
|
registerServlet(ourWebContainer, finalProperties);
|
||||||
log.debugv("Servlet with alias " + getAlias() + " registered to secured web container");
|
log.debugv("Servlet with alias " + getAlias() + " registered to secured web container");
|
||||||
return ourWebContainer;
|
return ourWebContainer;
|
||||||
}
|
}
|
||||||
@@ -122,28 +126,82 @@ public class ServletReregistrationService {
|
|||||||
|
|
||||||
// Re-register servlet back to original context
|
// Re-register servlet back to original context
|
||||||
WebContainer externalWebContainer = findExternalWebContainer();
|
WebContainer externalWebContainer = findExternalWebContainer();
|
||||||
Servlet servlet = (Servlet) bundleContext.getService(servletReference);
|
registerServlet(externalWebContainer, obtainProperties());
|
||||||
registerServlet(externalWebContainer, servlet);
|
|
||||||
log.debug("Servlet with alias " + getAlias() + " registered back to external web container");
|
log.debug("Servlet with alias " + getAlias() + " registered back to external web container");
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getAlias() {
|
private String getAlias() {
|
||||||
return (String) servletReference.getProperty("alias");
|
return alias;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void registerServlet(WebContainer webContainer, Servlet servlet) {
|
/**
|
||||||
|
* Code comes from org.apache.cxf.transport.http.osgi.ServletExporter#updated(java.util.Dictionary)
|
||||||
|
* @param webContainer
|
||||||
|
* @param properties
|
||||||
|
*/
|
||||||
|
protected void registerServlet(WebContainer webContainer, Dictionary properties) {
|
||||||
|
HttpContext httpContext = webContainer.createDefaultHttpContext();
|
||||||
|
|
||||||
|
ServiceReference destinationServiceServiceReference = bundleContext.getServiceReference("org.apache.cxf.transport.http.DestinationRegistry");
|
||||||
|
DestinationRegistry destinationRegistry = (DestinationRegistry) bundleContext.getService(destinationServiceServiceReference);
|
||||||
|
|
||||||
|
Servlet servlet = new CXFNonSpringServlet(destinationRegistry, false);
|
||||||
try {
|
try {
|
||||||
|
if (properties == null) {
|
||||||
|
properties = new Properties();
|
||||||
|
}
|
||||||
|
Properties sprops = new Properties();
|
||||||
|
sprops.put("init-prefix",
|
||||||
|
getProp(properties, CXF_SERVLET_PREFIX + "init-prefix", ""));
|
||||||
|
sprops.put("servlet-name",
|
||||||
|
getProp(properties, CXF_SERVLET_PREFIX + "name", "cxf-osgi-transport-servlet"));
|
||||||
|
sprops.put("hide-service-list-page",
|
||||||
|
getProp(properties, CXF_SERVLET_PREFIX + "hide-service-list-page", "false"));
|
||||||
|
sprops.put("disable-address-updates",
|
||||||
|
getProp(properties, CXF_SERVLET_PREFIX + "disable-address-updates", "true"));
|
||||||
|
sprops.put("base-address",
|
||||||
|
getProp(properties, CXF_SERVLET_PREFIX + "base-address", ""));
|
||||||
|
sprops.put("service-list-path",
|
||||||
|
getProp(properties, CXF_SERVLET_PREFIX + "service-list-path", ""));
|
||||||
|
sprops.put("static-resources-list",
|
||||||
|
getProp(properties, CXF_SERVLET_PREFIX + "static-resources-list", ""));
|
||||||
|
sprops.put("redirects-list",
|
||||||
|
getProp(properties, CXF_SERVLET_PREFIX + "redirects-list", ""));
|
||||||
|
sprops.put("redirect-servlet-name",
|
||||||
|
getProp(properties, CXF_SERVLET_PREFIX + "redirect-servlet-name", ""));
|
||||||
|
sprops.put("redirect-servlet-path",
|
||||||
|
getProp(properties, CXF_SERVLET_PREFIX + "redirect-servlet-path", ""));
|
||||||
|
sprops.put("service-list-all-contexts",
|
||||||
|
getProp(properties, CXF_SERVLET_PREFIX + "service-list-all-contexts", ""));
|
||||||
|
sprops.put("service-list-page-authenticate",
|
||||||
|
getProp(properties, CXF_SERVLET_PREFIX + "service-list-page-authenticate", "false"));
|
||||||
|
sprops.put("service-list-page-authenticate-realm",
|
||||||
|
getProp(properties, CXF_SERVLET_PREFIX + "service-list-page-authenticate-realm", "karaf"));
|
||||||
|
sprops.put("use-x-forwarded-headers",
|
||||||
|
getProp(properties, CXF_SERVLET_PREFIX + "use-x-forwarded-headers", "false"));
|
||||||
|
|
||||||
|
// Accept extra properties by default, can be disabled if it is really needed
|
||||||
|
if (Boolean.valueOf(getProp(properties, CXF_SERVLET_PREFIX + "support.extra.properties", "true").toString())) {
|
||||||
|
Enumeration keys = properties.keys();
|
||||||
|
while (keys.hasMoreElements()) {
|
||||||
|
String nextKey = keys.nextElement().toString();
|
||||||
|
if (!nextKey.startsWith(CXF_SERVLET_PREFIX)) {
|
||||||
|
sprops.put(nextKey, properties.get(nextKey));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Hashtable<String, Object> servletInitParams = new Hashtable<String, Object>();
|
Hashtable<String, Object> servletInitParams = new Hashtable<String, Object>();
|
||||||
String[] propNames = servletReference.getPropertyKeys();
|
Enumeration keys = sprops.keys();
|
||||||
for (String propName : propNames) {
|
|
||||||
|
while(keys.hasMoreElements()){
|
||||||
|
String propName = (String) keys.nextElement();
|
||||||
if (!FILTERED_PROPERTIES.contains(propName)) {
|
if (!FILTERED_PROPERTIES.contains(propName)) {
|
||||||
servletInitParams.put(propName, servletReference.getProperty(propName));
|
servletInitParams.put(propName, sprops.getProperty(propName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to register servlet in given web container now
|
// Try to register servlet in given web container now
|
||||||
HttpContext httpContext = webContainer.createDefaultHttpContext();
|
|
||||||
String alias = (String) servletReference.getProperty("alias");
|
|
||||||
webContainer.registerServlet(alias, servlet, servletInitParams, httpContext);
|
webContainer.registerServlet(alias, servlet, servletInitParams, httpContext);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Can't register servlet in web container", e);
|
log.error("Can't register servlet in web container", e);
|
||||||
@@ -156,7 +214,7 @@ public class ServletReregistrationService {
|
|||||||
* @return web container or null
|
* @return web container or null
|
||||||
*/
|
*/
|
||||||
protected WebContainer findExternalWebContainer() {
|
protected WebContainer findExternalWebContainer() {
|
||||||
BundleContext servletBundleContext = servletReference.getBundle().getBundleContext();
|
BundleContext servletBundleContext = managedServiceReference.getBundle().getBundleContext();
|
||||||
ServiceReference webContainerReference = servletBundleContext.getServiceReference(WebContainer.class.getName());
|
ServiceReference webContainerReference = servletBundleContext.getServiceReference(WebContainer.class.getName());
|
||||||
if (webContainerReference == null) {
|
if (webContainerReference == null) {
|
||||||
log.warn("Not found webContainer reference for bundle " + servletBundleContext);
|
log.warn("Not found webContainer reference for bundle " + servletBundleContext);
|
||||||
@@ -166,4 +224,32 @@ public class ServletReregistrationService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Dictionary obtainProperties(){
|
||||||
|
Dictionary properties = null;
|
||||||
|
ServiceReference reference = bundleContext.getServiceReference(ConfigurationAdmin.class.getName());
|
||||||
|
ConfigurationAdmin admin = (ConfigurationAdmin) bundleContext.getService(reference);
|
||||||
|
try {
|
||||||
|
Configuration configuration = admin.getConfiguration("org.apache.cxf.osgi");
|
||||||
|
properties = configuration.getProperties();
|
||||||
|
} catch (Exception e){
|
||||||
|
log.warn("Unable to obtain cxf osgi configadmin reference.", e);
|
||||||
|
}
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Object getProp(Dictionary properties, String key, Object defaultValue) {
|
||||||
|
Object value = null;
|
||||||
|
if(properties != null){
|
||||||
|
value = properties.get(key);
|
||||||
|
}
|
||||||
|
return value == null ? defaultValue : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ServiceReference getManagedServiceReference() {
|
||||||
|
return managedServiceReference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setManagedServiceReference(ServiceReference managedServiceReference) {
|
||||||
|
this.managedServiceReference = managedServiceReference;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<name>Keycloak OIDC Client Adapter Modules</name>
|
<name>Keycloak OIDC Client Adapter Modules</name>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
+9
-3
@@ -51,10 +51,16 @@ public class OIDCFilterSessionStore extends FilterSessionStore implements Adapte
|
|||||||
}
|
}
|
||||||
|
|
||||||
public HttpServletRequestWrapper buildWrapper() {
|
public HttpServletRequestWrapper buildWrapper() {
|
||||||
HttpSession session = request.getSession();
|
HttpSession session = request.getSession(false);
|
||||||
KeycloakAccount account = (KeycloakAccount)session.getAttribute(KeycloakAccount.class.getName());
|
KeycloakAccount account = null;
|
||||||
|
if (session != null) {
|
||||||
|
account = (KeycloakAccount) session.getAttribute(KeycloakAccount.class.getName());
|
||||||
|
if (account == null) {
|
||||||
|
account = (KeycloakAccount) request.getAttribute(KeycloakAccount.class.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
if (account == null) {
|
if (account == null) {
|
||||||
account = (KeycloakAccount)request.getAttribute(KeycloakAccount.class.getName());
|
account = (KeycloakAccount) request.getAttribute(KeycloakAccount.class.getName());
|
||||||
}
|
}
|
||||||
return buildWrapper(session, account);
|
return buildWrapper(session, account);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
+1
-1
@@ -33,7 +33,7 @@ public class ServletOAuthClientBuilderTest {
|
|||||||
public void testBuilder() {
|
public void testBuilder() {
|
||||||
ServletOAuthClient oauthClient = ServletOAuthClientBuilder.build(getClass().getResourceAsStream("/keycloak.json"));
|
ServletOAuthClient oauthClient = ServletOAuthClientBuilder.build(getClass().getResourceAsStream("/keycloak.json"));
|
||||||
Assert.assertEquals("https://localhost:8443/auth/realms/demo/protocol/openid-connect/auth", oauthClient.getDeployment().getAuthUrl().clone().build().toString());
|
Assert.assertEquals("https://localhost:8443/auth/realms/demo/protocol/openid-connect/auth", oauthClient.getDeployment().getAuthUrl().clone().build().toString());
|
||||||
Assert.assertEquals("https://backend:8443/auth/realms/demo/protocol/openid-connect/token", oauthClient.getDeployment().getTokenUrl());
|
Assert.assertEquals("https://localhost:8443/auth/realms/demo/protocol/openid-connect/token", oauthClient.getDeployment().getTokenUrl());
|
||||||
assertEquals(RelativeUrlsUsed.NEVER, oauthClient.getRelativeUrlsUsed());
|
assertEquals(RelativeUrlsUsed.NEVER, oauthClient.getRelativeUrlsUsed());
|
||||||
Assert.assertEquals("customer-portal", oauthClient.getClientId());
|
Assert.assertEquals("customer-portal", oauthClient.getClientId());
|
||||||
Assert.assertEquals("234234-234234-234234", oauthClient.getCredentials().get(CredentialRepresentation.SECRET));
|
Assert.assertEquals("234234-234234-234234", oauthClient.getCredentials().get(CredentialRepresentation.SECRET));
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
"connection-pool-size": 20,
|
"connection-pool-size": 20,
|
||||||
"disable-trust-manager": true,
|
"disable-trust-manager": true,
|
||||||
"allow-any-hostname": true,
|
"allow-any-hostname": true,
|
||||||
"auth-server-url-for-backend-requests": "https://backend:8443/auth",
|
|
||||||
"always-refresh-token": true,
|
"always-refresh-token": true,
|
||||||
"register-node-at-startup": true,
|
"register-node-at-startup": true,
|
||||||
"register-node-period": 1000,
|
"register-node-period": 1000,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<name>Keycloak Tomcat Integration</name>
|
<name>Keycloak Tomcat Integration</name>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-tomcat-integration-pom</artifactId>
|
<artifactId>keycloak-tomcat-integration-pom</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-core</artifactId>
|
<artifactId>keycloak-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-adapter-spi</artifactId>
|
<artifactId>keycloak-adapter-spi</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-tomcat-integration-pom</artifactId>
|
<artifactId>keycloak-tomcat-integration-pom</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-tomcat-integration-pom</artifactId>
|
<artifactId>keycloak-tomcat-integration-pom</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-tomcat-integration-pom</artifactId>
|
<artifactId>keycloak-tomcat-integration-pom</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<name>Keycloak WildFly Integration</name>
|
<name>Keycloak WildFly Integration</name>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../../pom.xml</relativePath>
|
<relativePath>../../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../../pom.xml</relativePath>
|
<relativePath>../../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../../pom.xml</relativePath>
|
<relativePath>../../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<name>Keycloak Integration</name>
|
<name>Keycloak Integration</name>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-saml-eap-integration-pom</artifactId>
|
<artifactId>keycloak-saml-eap-integration-pom</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -43,6 +43,10 @@
|
|||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-adapter-spi</artifactId>
|
<artifactId>keycloak-adapter-spi</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<name>Keycloak SAML EAP Integration</name>
|
<name>Keycloak SAML EAP Integration</name>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-saml-eap-integration-pom</artifactId>
|
<artifactId>keycloak-saml-eap-integration-pom</artifactId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
+2
@@ -45,6 +45,7 @@ public class Constants {
|
|||||||
static final String KEY_STORE = "KeyStore";
|
static final String KEY_STORE = "KeyStore";
|
||||||
static final String SIGN_REQUEST = "signRequest";
|
static final String SIGN_REQUEST = "signRequest";
|
||||||
static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature";
|
static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature";
|
||||||
|
static final String VALIDATE_ASSERTION_SIGNATURE = "validateAssertionSignature";
|
||||||
static final String REQUEST_BINDING = "requestBinding";
|
static final String REQUEST_BINDING = "requestBinding";
|
||||||
static final String BINDING_URL = "bindingUrl";
|
static final String BINDING_URL = "bindingUrl";
|
||||||
static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature";
|
static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature";
|
||||||
@@ -97,6 +98,7 @@ public class Constants {
|
|||||||
static final String CERTIFICATE_ALIAS = "alias";
|
static final String CERTIFICATE_ALIAS = "alias";
|
||||||
static final String SIGN_REQUEST = "signRequest";
|
static final String SIGN_REQUEST = "signRequest";
|
||||||
static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature";
|
static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature";
|
||||||
|
static final String VALIDATE_ASSERTION_SIGNATURE = "validateAssertionSignature";
|
||||||
static final String REQUEST_BINDING = "requestBinding";
|
static final String REQUEST_BINDING = "requestBinding";
|
||||||
static final String BINDING_URL = "bindingUrl";
|
static final String BINDING_URL = "bindingUrl";
|
||||||
static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature";
|
static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature";
|
||||||
|
|||||||
+2
@@ -39,6 +39,7 @@ public abstract class KeycloakDependencyProcessor implements DeploymentUnitProce
|
|||||||
|
|
||||||
private static final ModuleIdentifier KEYCLOAK_JBOSS_CORE_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-jboss-adapter-core");
|
private static final ModuleIdentifier KEYCLOAK_JBOSS_CORE_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-jboss-adapter-core");
|
||||||
private static final ModuleIdentifier KEYCLOAK_CORE_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-saml-adapter-core");
|
private static final ModuleIdentifier KEYCLOAK_CORE_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-saml-adapter-core");
|
||||||
|
private static final ModuleIdentifier KEYCLOAK_API_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-saml-adapter-api-public");
|
||||||
private static final ModuleIdentifier KEYCLOAK_COMMON = ModuleIdentifier.create("org.keycloak.keycloak-common");
|
private static final ModuleIdentifier KEYCLOAK_COMMON = ModuleIdentifier.create("org.keycloak.keycloak-common");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -70,6 +71,7 @@ public abstract class KeycloakDependencyProcessor implements DeploymentUnitProce
|
|||||||
private void addCommonModules(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader) {
|
private void addCommonModules(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader) {
|
||||||
// ModuleDependency(ModuleLoader moduleLoader, ModuleIdentifier identifier, boolean optional, boolean export, boolean importServices, boolean userSpecified)
|
// ModuleDependency(ModuleLoader moduleLoader, ModuleIdentifier identifier, boolean optional, boolean export, boolean importServices, boolean userSpecified)
|
||||||
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_JBOSS_CORE_ADAPTER, false, false, false, false));
|
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_JBOSS_CORE_ADAPTER, false, false, false, false));
|
||||||
|
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_API_ADAPTER, false, false, false, false));
|
||||||
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_CORE_ADAPTER, false, false, false, false));
|
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_CORE_ADAPTER, false, false, false, false));
|
||||||
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_COMMON, false, false, false, false));
|
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_COMMON, false, false, false, false));
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -37,6 +37,11 @@ abstract class SingleSignOnDefinition {
|
|||||||
.setXmlName(Constants.XML.VALIDATE_RESPONSE_SIGNATURE)
|
.setXmlName(Constants.XML.VALIDATE_RESPONSE_SIGNATURE)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
static final SimpleAttributeDefinition VALIDATE_ASSERTION_SIGNATURE =
|
||||||
|
new SimpleAttributeDefinitionBuilder(Constants.Model.VALIDATE_ASSERTION_SIGNATURE, ModelType.BOOLEAN, true)
|
||||||
|
.setXmlName(Constants.XML.VALIDATE_ASSERTION_SIGNATURE)
|
||||||
|
.build();
|
||||||
|
|
||||||
static final SimpleAttributeDefinition REQUEST_BINDING =
|
static final SimpleAttributeDefinition REQUEST_BINDING =
|
||||||
new SimpleAttributeDefinitionBuilder(Constants.Model.REQUEST_BINDING, ModelType.STRING, true)
|
new SimpleAttributeDefinitionBuilder(Constants.Model.REQUEST_BINDING, ModelType.STRING, true)
|
||||||
.setXmlName(Constants.XML.REQUEST_BINDING)
|
.setXmlName(Constants.XML.REQUEST_BINDING)
|
||||||
@@ -52,7 +57,7 @@ abstract class SingleSignOnDefinition {
|
|||||||
.setXmlName(Constants.XML.BINDING_URL)
|
.setXmlName(Constants.XML.BINDING_URL)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGN_REQUEST, VALIDATE_RESPONSE_SIGNATURE, REQUEST_BINDING, RESPONSE_BINDING, BINDING_URL};
|
static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGN_REQUEST, VALIDATE_RESPONSE_SIGNATURE, VALIDATE_ASSERTION_SIGNATURE, REQUEST_BINDING, RESPONSE_BINDING, BINDING_URL};
|
||||||
|
|
||||||
static final HashMap<String, SimpleAttributeDefinition> ATTRIBUTE_MAP = new HashMap<>();
|
static final HashMap<String, SimpleAttributeDefinition> ATTRIBUTE_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
|||||||
+1
@@ -67,6 +67,7 @@ keycloak-saml.IDP.signatureCanonicalizationMethod=Signature canonicalization met
|
|||||||
keycloak-saml.IDP.SingleSignOnService=Single sign-on configuration
|
keycloak-saml.IDP.SingleSignOnService=Single sign-on configuration
|
||||||
keycloak-saml.IDP.SingleSignOnService.signRequest=Sign SSO requests
|
keycloak-saml.IDP.SingleSignOnService.signRequest=Sign SSO requests
|
||||||
keycloak-saml.IDP.SingleSignOnService.validateResponseSignature=Validate an SSO response signature
|
keycloak-saml.IDP.SingleSignOnService.validateResponseSignature=Validate an SSO response signature
|
||||||
|
keycloak-saml.IDP.SingleSignOnService.validateAssertionSignature=Validate an SSO assertion signature
|
||||||
keycloak-saml.IDP.SingleSignOnService.requestBinding=HTTP method to use for requests
|
keycloak-saml.IDP.SingleSignOnService.requestBinding=HTTP method to use for requests
|
||||||
keycloak-saml.IDP.SingleSignOnService.responseBinding=HTTP method to use for responses
|
keycloak-saml.IDP.SingleSignOnService.responseBinding=HTTP method to use for responses
|
||||||
keycloak-saml.IDP.SingleSignOnService.bindingUrl=SSO endpoint URL
|
keycloak-saml.IDP.SingleSignOnService.bindingUrl=SSO endpoint URL
|
||||||
|
|||||||
+5
@@ -132,6 +132,11 @@
|
|||||||
<xs:documentation>Validate the SSO response signature</xs:documentation>
|
<xs:documentation>Validate the SSO response signature</xs:documentation>
|
||||||
</xs:annotation>
|
</xs:annotation>
|
||||||
</xs:attribute>
|
</xs:attribute>
|
||||||
|
<xs:attribute name="validateAssertionSignature" type="xs:boolean" use="optional">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:documentation>Validate the SSO assertion signature</xs:documentation>
|
||||||
|
</xs:annotation>
|
||||||
|
</xs:attribute>
|
||||||
<xs:attribute name="requestBinding" type="xs:string" use="optional">
|
<xs:attribute name="requestBinding" type="xs:string" use="optional">
|
||||||
<xs:annotation>
|
<xs:annotation>
|
||||||
<xs:documentation>HTTP method to use for requests</xs:documentation>
|
<xs:documentation>HTTP method to use for requests</xs:documentation>
|
||||||
|
|||||||
+1
@@ -42,6 +42,7 @@
|
|||||||
<IDP entityID="idp">
|
<IDP entityID="idp">
|
||||||
<SingleSignOnService signRequest="true"
|
<SingleSignOnService signRequest="true"
|
||||||
validateResponseSignature="true"
|
validateResponseSignature="true"
|
||||||
|
validateAssertionSignature="true"
|
||||||
requestBinding="POST"
|
requestBinding="POST"
|
||||||
bindingUrl="http://localhost:8080/auth/realms/saml-demo/protocol/saml"/>
|
bindingUrl="http://localhost:8080/auth/realms/saml-demo/protocol/saml"/>
|
||||||
<SingleLogoutService
|
<SingleLogoutService
|
||||||
|
|||||||
Executable
+82
@@ -0,0 +1,82 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||||
|
~ and other contributors as indicated by the @author tags.
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>keycloak-parent</artifactId>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<version>1.9.5.Final</version>
|
||||||
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||||
|
<name>Keycloak SAML Client Adapter Public API</name>
|
||||||
|
<description/>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<timestamp>${maven.build.timestamp}</timestamp>
|
||||||
|
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-saml-core-public</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-saml-core</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-adapter-spi</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-common</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jboss.logging</groupId>
|
||||||
|
<artifactId>jboss-logging</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>${maven.compiler.source}</source>
|
||||||
|
<target>${maven.compiler.target}</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
-1
@@ -19,7 +19,6 @@ package org.keycloak.adapters.saml;
|
|||||||
|
|
||||||
import org.keycloak.adapters.spi.AuthenticationError;
|
import org.keycloak.adapters.spi.AuthenticationError;
|
||||||
import org.keycloak.dom.saml.v2.protocol.StatusResponseType;
|
import org.keycloak.dom.saml.v2.protocol.StatusResponseType;
|
||||||
import org.keycloak.dom.saml.v2.protocol.StatusType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object that describes the SAML error that happened.
|
* Object that describes the SAML error that happened.
|
||||||
File renamed without changes.
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -35,6 +35,11 @@
|
|||||||
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
|
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-saml-core-public</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-saml-core</artifactId>
|
<artifactId>keycloak-saml-core</artifactId>
|
||||||
@@ -45,6 +50,11 @@
|
|||||||
<artifactId>keycloak-adapter-spi</artifactId>
|
<artifactId>keycloak-adapter-spi</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-common</artifactId>
|
<artifactId>keycloak-common</artifactId>
|
||||||
|
|||||||
+49
-40
@@ -26,7 +26,6 @@ import org.keycloak.saml.SAML2NameIDPolicyBuilder;
|
|||||||
import org.keycloak.saml.common.constants.JBossSAMLURIConstants;
|
import org.keycloak.saml.common.constants.JBossSAMLURIConstants;
|
||||||
import org.keycloak.saml.common.exceptions.ConfigurationException;
|
import org.keycloak.saml.common.exceptions.ConfigurationException;
|
||||||
import org.keycloak.saml.common.exceptions.ProcessingException;
|
import org.keycloak.saml.common.exceptions.ProcessingException;
|
||||||
import org.w3c.dom.Document;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.security.KeyPair;
|
import java.security.KeyPair;
|
||||||
@@ -54,45 +53,8 @@ public abstract class AbstractInitiateLogin implements AuthChallenge {
|
|||||||
@Override
|
@Override
|
||||||
public boolean challenge(HttpFacade httpFacade) {
|
public boolean challenge(HttpFacade httpFacade) {
|
||||||
try {
|
try {
|
||||||
String issuerURL = deployment.getEntityID();
|
SAML2AuthnRequestBuilder authnRequestBuilder = buildSaml2AuthnRequestBuilder(deployment);
|
||||||
String nameIDPolicyFormat = deployment.getNameIDPolicyFormat();
|
BaseSAML2BindingBuilder binding = createSaml2Binding(deployment);
|
||||||
|
|
||||||
if (nameIDPolicyFormat == null) {
|
|
||||||
nameIDPolicyFormat = JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
SAML2AuthnRequestBuilder authnRequestBuilder = new SAML2AuthnRequestBuilder()
|
|
||||||
.destination(deployment.getIDP().getSingleSignOnService().getRequestBindingUrl())
|
|
||||||
.issuer(issuerURL)
|
|
||||||
.forceAuthn(deployment.isForceAuthentication()).isPassive(deployment.isIsPassive())
|
|
||||||
.nameIdPolicy(SAML2NameIDPolicyBuilder.format(nameIDPolicyFormat));
|
|
||||||
if (deployment.getIDP().getSingleSignOnService().getResponseBinding() != null) {
|
|
||||||
String protocolBinding = JBossSAMLURIConstants.SAML_HTTP_REDIRECT_BINDING.get();
|
|
||||||
if (deployment.getIDP().getSingleSignOnService().getResponseBinding() == SamlDeployment.Binding.POST) {
|
|
||||||
protocolBinding = JBossSAMLURIConstants.SAML_HTTP_POST_BINDING.get();
|
|
||||||
}
|
|
||||||
authnRequestBuilder.protocolBinding(protocolBinding);
|
|
||||||
|
|
||||||
}
|
|
||||||
if (deployment.getAssertionConsumerServiceUrl() != null) {
|
|
||||||
authnRequestBuilder.assertionConsumerUrl(deployment.getAssertionConsumerServiceUrl());
|
|
||||||
}
|
|
||||||
BaseSAML2BindingBuilder binding = new BaseSAML2BindingBuilder();
|
|
||||||
|
|
||||||
if (deployment.getIDP().getSingleSignOnService().signRequest()) {
|
|
||||||
|
|
||||||
|
|
||||||
KeyPair keypair = deployment.getSigningKeyPair();
|
|
||||||
if (keypair == null) {
|
|
||||||
throw new RuntimeException("Signing keys not configured");
|
|
||||||
}
|
|
||||||
if (deployment.getSignatureCanonicalizationMethod() != null) {
|
|
||||||
binding.canonicalizationMethod(deployment.getSignatureCanonicalizationMethod());
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.signWith(keypair);
|
|
||||||
binding.signDocument();
|
|
||||||
}
|
|
||||||
sessionStore.saveRequest();
|
sessionStore.saveRequest();
|
||||||
|
|
||||||
sendAuthnRequest(httpFacade, authnRequestBuilder, binding);
|
sendAuthnRequest(httpFacade, authnRequestBuilder, binding);
|
||||||
@@ -103,6 +65,53 @@ public abstract class AbstractInitiateLogin implements AuthChallenge {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static BaseSAML2BindingBuilder createSaml2Binding(SamlDeployment deployment) {
|
||||||
|
BaseSAML2BindingBuilder binding = new BaseSAML2BindingBuilder();
|
||||||
|
|
||||||
|
if (deployment.getIDP().getSingleSignOnService().signRequest()) {
|
||||||
|
|
||||||
|
binding.signatureAlgorithm(deployment.getSignatureAlgorithm());
|
||||||
|
KeyPair keypair = deployment.getSigningKeyPair();
|
||||||
|
if (keypair == null) {
|
||||||
|
throw new RuntimeException("Signing keys not configured");
|
||||||
|
}
|
||||||
|
if (deployment.getSignatureCanonicalizationMethod() != null) {
|
||||||
|
binding.canonicalizationMethod(deployment.getSignatureCanonicalizationMethod());
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.signWith(keypair);
|
||||||
|
binding.signDocument();
|
||||||
|
}
|
||||||
|
return binding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SAML2AuthnRequestBuilder buildSaml2AuthnRequestBuilder(SamlDeployment deployment) {
|
||||||
|
String issuerURL = deployment.getEntityID();
|
||||||
|
String nameIDPolicyFormat = deployment.getNameIDPolicyFormat();
|
||||||
|
|
||||||
|
if (nameIDPolicyFormat == null) {
|
||||||
|
nameIDPolicyFormat = JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
SAML2AuthnRequestBuilder authnRequestBuilder = new SAML2AuthnRequestBuilder()
|
||||||
|
.destination(deployment.getIDP().getSingleSignOnService().getRequestBindingUrl())
|
||||||
|
.issuer(issuerURL)
|
||||||
|
.forceAuthn(deployment.isForceAuthentication()).isPassive(deployment.isIsPassive())
|
||||||
|
.nameIdPolicy(SAML2NameIDPolicyBuilder.format(nameIDPolicyFormat));
|
||||||
|
if (deployment.getIDP().getSingleSignOnService().getResponseBinding() != null) {
|
||||||
|
String protocolBinding = JBossSAMLURIConstants.SAML_HTTP_REDIRECT_BINDING.get();
|
||||||
|
if (deployment.getIDP().getSingleSignOnService().getResponseBinding() == SamlDeployment.Binding.POST) {
|
||||||
|
protocolBinding = JBossSAMLURIConstants.SAML_HTTP_POST_BINDING.get();
|
||||||
|
}
|
||||||
|
authnRequestBuilder.protocolBinding(protocolBinding);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (deployment.getAssertionConsumerServiceUrl() != null) {
|
||||||
|
authnRequestBuilder.assertionConsumerUrl(deployment.getAssertionConsumerServiceUrl());
|
||||||
|
}
|
||||||
|
return authnRequestBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
protected abstract void sendAuthnRequest(HttpFacade httpFacade, SAML2AuthnRequestBuilder authnRequestBuilder, BaseSAML2BindingBuilder binding) throws ProcessingException, ConfigurationException, IOException;
|
protected abstract void sendAuthnRequest(HttpFacade httpFacade, SAML2AuthnRequestBuilder authnRequestBuilder, BaseSAML2BindingBuilder binding) throws ProcessingException, ConfigurationException, IOException;
|
||||||
|
|
||||||
}
|
}
|
||||||
+10
@@ -34,6 +34,7 @@ public class DefaultSamlDeployment implements SamlDeployment {
|
|||||||
public static class DefaultSingleSignOnService implements IDP.SingleSignOnService {
|
public static class DefaultSingleSignOnService implements IDP.SingleSignOnService {
|
||||||
private boolean signRequest;
|
private boolean signRequest;
|
||||||
private boolean validateResponseSignature;
|
private boolean validateResponseSignature;
|
||||||
|
private boolean validateAssertionSignature;
|
||||||
private Binding requestBinding;
|
private Binding requestBinding;
|
||||||
private Binding responseBinding;
|
private Binding responseBinding;
|
||||||
private String requestBindingUrl;
|
private String requestBindingUrl;
|
||||||
@@ -48,6 +49,11 @@ public class DefaultSamlDeployment implements SamlDeployment {
|
|||||||
return validateResponseSignature;
|
return validateResponseSignature;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean validateAssertionSignature() {
|
||||||
|
return validateAssertionSignature;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Binding getRequestBinding() {
|
public Binding getRequestBinding() {
|
||||||
return requestBinding;
|
return requestBinding;
|
||||||
@@ -71,6 +77,10 @@ public class DefaultSamlDeployment implements SamlDeployment {
|
|||||||
this.validateResponseSignature = validateResponseSignature;
|
this.validateResponseSignature = validateResponseSignature;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setValidateAssertionSignature(boolean validateAssertionSignature) {
|
||||||
|
this.validateAssertionSignature = validateAssertionSignature;
|
||||||
|
}
|
||||||
|
|
||||||
public void setRequestBinding(Binding requestBinding) {
|
public void setRequestBinding(Binding requestBinding) {
|
||||||
this.requestBinding = requestBinding;
|
this.requestBinding = requestBinding;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public interface SamlDeployment {
|
|||||||
public interface SingleSignOnService {
|
public interface SingleSignOnService {
|
||||||
boolean signRequest();
|
boolean signRequest();
|
||||||
boolean validateResponseSignature();
|
boolean validateResponseSignature();
|
||||||
|
boolean validateAssertionSignature();
|
||||||
Binding getRequestBinding();
|
Binding getRequestBinding();
|
||||||
Binding getResponseBinding();
|
Binding getResponseBinding();
|
||||||
String getRequestBindingUrl();
|
String getRequestBindingUrl();
|
||||||
|
|||||||
@@ -18,8 +18,6 @@
|
|||||||
package org.keycloak.adapters.saml;
|
package org.keycloak.adapters.saml;
|
||||||
|
|
||||||
import org.keycloak.adapters.spi.AdapterSessionStore;
|
import org.keycloak.adapters.spi.AdapterSessionStore;
|
||||||
import org.keycloak.dom.saml.v2.protocol.StatusResponseType;
|
|
||||||
import org.keycloak.dom.saml.v2.protocol.StatusType;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ public class IDP implements Serializable {
|
|||||||
private String requestBinding;
|
private String requestBinding;
|
||||||
private String responseBinding;
|
private String responseBinding;
|
||||||
private String bindingUrl;
|
private String bindingUrl;
|
||||||
|
private boolean validateAssertionSignature;
|
||||||
|
|
||||||
public boolean isSignRequest() {
|
public boolean isSignRequest() {
|
||||||
return signRequest;
|
return signRequest;
|
||||||
@@ -50,6 +51,14 @@ public class IDP implements Serializable {
|
|||||||
this.validateResponseSignature = validateResponseSignature;
|
this.validateResponseSignature = validateResponseSignature;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isValidateAssertionSignature() {
|
||||||
|
return validateAssertionSignature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValidateAssertionSignature(boolean validateAssertionSignature) {
|
||||||
|
this.validateAssertionSignature = validateAssertionSignature;
|
||||||
|
}
|
||||||
|
|
||||||
public String getRequestBinding() {
|
public String getRequestBinding() {
|
||||||
return requestBinding;
|
return requestBinding;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -68,6 +68,7 @@ public class ConfigXmlConstants {
|
|||||||
public static final String RESPONSE_BINDING_ATTR = "responseBinding";
|
public static final String RESPONSE_BINDING_ATTR = "responseBinding";
|
||||||
public static final String BINDING_URL_ATTR = "bindingUrl";
|
public static final String BINDING_URL_ATTR = "bindingUrl";
|
||||||
public static final String VALIDATE_RESPONSE_SIGNATURE_ATTR = "validateResponseSignature";
|
public static final String VALIDATE_RESPONSE_SIGNATURE_ATTR = "validateResponseSignature";
|
||||||
|
public static final String VALIDATE_ASSERTION_SIGNATURE_ATTR = "validateAssertionSignature";
|
||||||
public static final String VALIDATE_REQUEST_SIGNATURE_ATTR = "validateRequestSignature";
|
public static final String VALIDATE_REQUEST_SIGNATURE_ATTR = "validateRequestSignature";
|
||||||
public static final String POST_BINDING_URL_ATTR = "postBindingUrl";
|
public static final String POST_BINDING_URL_ATTR = "postBindingUrl";
|
||||||
public static final String REDIRECT_BINDING_URL_ATTR = "redirectBindingUrl";
|
public static final String REDIRECT_BINDING_URL_ATTR = "redirectBindingUrl";
|
||||||
|
|||||||
+1
@@ -149,6 +149,7 @@ public class DeploymentBuilder {
|
|||||||
}
|
}
|
||||||
sso.setSignRequest(sp.getIdp().getSingleSignOnService().isSignRequest());
|
sso.setSignRequest(sp.getIdp().getSingleSignOnService().isSignRequest());
|
||||||
sso.setValidateResponseSignature(sp.getIdp().getSingleSignOnService().isValidateResponseSignature());
|
sso.setValidateResponseSignature(sp.getIdp().getSingleSignOnService().isValidateResponseSignature());
|
||||||
|
sso.setValidateAssertionSignature(sp.getIdp().getSingleSignOnService().isValidateAssertionSignature());
|
||||||
|
|
||||||
slo.setSignRequest(sp.getIdp().getSingleLogoutService().isSignRequest());
|
slo.setSignRequest(sp.getIdp().getSingleLogoutService().isSignRequest());
|
||||||
slo.setSignResponse(sp.getIdp().getSingleLogoutService().isSignResponse());
|
slo.setSignResponse(sp.getIdp().getSingleLogoutService().isSignResponse());
|
||||||
|
|||||||
+1
@@ -106,6 +106,7 @@ public class IDPXmlParser extends AbstractParser {
|
|||||||
StartElement element = StaxParserUtil.getNextStartElement(xmlEventReader);
|
StartElement element = StaxParserUtil.getNextStartElement(xmlEventReader);
|
||||||
sso.setSignRequest(SPXmlParser.getBooleanAttributeValue(element, ConfigXmlConstants.SIGN_REQUEST_ATTR, signaturesRequired));
|
sso.setSignRequest(SPXmlParser.getBooleanAttributeValue(element, ConfigXmlConstants.SIGN_REQUEST_ATTR, signaturesRequired));
|
||||||
sso.setValidateResponseSignature(SPXmlParser.getBooleanAttributeValue(element, ConfigXmlConstants.VALIDATE_RESPONSE_SIGNATURE_ATTR, signaturesRequired));
|
sso.setValidateResponseSignature(SPXmlParser.getBooleanAttributeValue(element, ConfigXmlConstants.VALIDATE_RESPONSE_SIGNATURE_ATTR, signaturesRequired));
|
||||||
|
sso.setValidateAssertionSignature(SPXmlParser.getBooleanAttributeValue(element, ConfigXmlConstants.VALIDATE_ASSERTION_SIGNATURE_ATTR));
|
||||||
sso.setRequestBinding(SPXmlParser.getAttributeValue(element, ConfigXmlConstants.REQUEST_BINDING_ATTR));
|
sso.setRequestBinding(SPXmlParser.getAttributeValue(element, ConfigXmlConstants.REQUEST_BINDING_ATTR));
|
||||||
sso.setResponseBinding(SPXmlParser.getAttributeValue(element, ConfigXmlConstants.RESPONSE_BINDING_ATTR));
|
sso.setResponseBinding(SPXmlParser.getAttributeValue(element, ConfigXmlConstants.RESPONSE_BINDING_ATTR));
|
||||||
sso.setBindingUrl(SPXmlParser.getAttributeValue(element, ConfigXmlConstants.BINDING_URL_ATTR));
|
sso.setBindingUrl(SPXmlParser.getAttributeValue(element, ConfigXmlConstants.BINDING_URL_ATTR));
|
||||||
|
|||||||
-1
@@ -25,7 +25,6 @@ import org.keycloak.saml.common.util.StaxParserUtil;
|
|||||||
|
|
||||||
import javax.xml.namespace.QName;
|
import javax.xml.namespace.QName;
|
||||||
import javax.xml.stream.XMLEventReader;
|
import javax.xml.stream.XMLEventReader;
|
||||||
import javax.xml.stream.XMLStreamException;
|
|
||||||
import javax.xml.stream.events.StartElement;
|
import javax.xml.stream.events.StartElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
-1
@@ -18,7 +18,6 @@
|
|||||||
package org.keycloak.adapters.saml.config.parsers;
|
package org.keycloak.adapters.saml.config.parsers;
|
||||||
|
|
||||||
import org.keycloak.adapters.saml.config.Key;
|
import org.keycloak.adapters.saml.config.Key;
|
||||||
import org.keycloak.adapters.saml.config.SP;
|
|
||||||
import org.keycloak.saml.common.exceptions.ParsingException;
|
import org.keycloak.saml.common.exceptions.ParsingException;
|
||||||
import org.keycloak.saml.common.parsers.AbstractParser;
|
import org.keycloak.saml.common.parsers.AbstractParser;
|
||||||
import org.keycloak.saml.common.util.StaxParserUtil;
|
import org.keycloak.saml.common.util.StaxParserUtil;
|
||||||
|
|||||||
+28
-3
@@ -201,7 +201,7 @@ public abstract class AbstractSamlAuthenticationHandler implements SamlAuthentic
|
|||||||
return AuthOutcome.FAILED;
|
return AuthOutcome.FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return handleLoginResponse((ResponseType) statusResponse, onCreateSession);
|
return handleLoginResponse((ResponseType) statusResponse, postBinding, onCreateSession);
|
||||||
} finally {
|
} finally {
|
||||||
sessionStore.setCurrentAction(SamlSessionStore.CurrentAction.NONE);
|
sessionStore.setCurrentAction(SamlSessionStore.CurrentAction.NONE);
|
||||||
}
|
}
|
||||||
@@ -272,8 +272,7 @@ public abstract class AbstractSamlAuthenticationHandler implements SamlAuthentic
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AuthOutcome handleLoginResponse(ResponseType responseType, OnSessionCreated onCreateSession) {
|
protected AuthOutcome handleLoginResponse(ResponseType responseType, boolean postBinding, OnSessionCreated onCreateSession) {
|
||||||
|
|
||||||
AssertionType assertion = null;
|
AssertionType assertion = null;
|
||||||
try {
|
try {
|
||||||
assertion = AssertionUtil.getAssertion(responseType, deployment.getDecryptionKey());
|
assertion = AssertionUtil.getAssertion(responseType, deployment.getDecryptionKey());
|
||||||
@@ -298,6 +297,32 @@ public abstract class AbstractSamlAuthenticationHandler implements SamlAuthentic
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (deployment.getIDP().getSingleSignOnService().validateAssertionSignature()) {
|
||||||
|
try {
|
||||||
|
validateSamlSignature(new SAMLDocumentHolder(AssertionUtil.asDocument(assertion)), postBinding, GeneralConstants.SAML_RESPONSE_KEY);
|
||||||
|
} catch (VerificationException e) {
|
||||||
|
log.error("Failed to verify saml assertion signature", e);
|
||||||
|
|
||||||
|
challenge = new AuthChallenge() {
|
||||||
|
@Override
|
||||||
|
public boolean challenge(HttpFacade exchange) {
|
||||||
|
SamlAuthenticationError error = new SamlAuthenticationError(SamlAuthenticationError.Reason.INVALID_SIGNATURE);
|
||||||
|
exchange.getRequest().setError(error);
|
||||||
|
exchange.getResponse().sendError(403);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getResponseCode() {
|
||||||
|
return 403;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return AuthOutcome.FAILED;
|
||||||
|
} catch (ProcessingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SubjectType subject = assertion.getSubject();
|
SubjectType subject = assertion.getSubject();
|
||||||
SubjectType.STSubType subType = subject.getSubType();
|
SubjectType.STSubType subType = subject.getSubType();
|
||||||
NameIDType subjectNameID = (NameIDType) subType.getBaseID();
|
NameIDType subjectNameID = (NameIDType) subType.getBaseID();
|
||||||
|
|||||||
-1
@@ -23,7 +23,6 @@ import org.keycloak.adapters.saml.SamlSessionStore;
|
|||||||
import org.keycloak.adapters.saml.profile.SamlInvocationContext;
|
import org.keycloak.adapters.saml.profile.SamlInvocationContext;
|
||||||
import org.keycloak.adapters.spi.AuthOutcome;
|
import org.keycloak.adapters.spi.AuthOutcome;
|
||||||
import org.keycloak.adapters.spi.HttpFacade;
|
import org.keycloak.adapters.spi.HttpFacade;
|
||||||
import org.keycloak.saml.common.constants.GeneralConstants;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||||
|
|||||||
-1
@@ -20,7 +20,6 @@ package org.keycloak.adapters.saml.profile.webbrowsersso;
|
|||||||
import org.keycloak.adapters.saml.OnSessionCreated;
|
import org.keycloak.adapters.saml.OnSessionCreated;
|
||||||
import org.keycloak.adapters.saml.SamlDeployment;
|
import org.keycloak.adapters.saml.SamlDeployment;
|
||||||
import org.keycloak.adapters.saml.SamlSessionStore;
|
import org.keycloak.adapters.saml.SamlSessionStore;
|
||||||
import org.keycloak.adapters.saml.profile.SamlInvocationContext;
|
|
||||||
import org.keycloak.adapters.spi.AuthOutcome;
|
import org.keycloak.adapters.spi.AuthOutcome;
|
||||||
import org.keycloak.adapters.spi.HttpFacade;
|
import org.keycloak.adapters.spi.HttpFacade;
|
||||||
import org.keycloak.saml.common.constants.GeneralConstants;
|
import org.keycloak.saml.common.constants.GeneralConstants;
|
||||||
|
|||||||
+5
-2
@@ -79,11 +79,11 @@ public class WebBrowserSsoAuthenticationHandler extends AbstractSamlAuthenticati
|
|||||||
builder.issuer(issuerURL);
|
builder.issuer(issuerURL);
|
||||||
BaseSAML2BindingBuilder binding = new BaseSAML2BindingBuilder().relayState(relayState);
|
BaseSAML2BindingBuilder binding = new BaseSAML2BindingBuilder().relayState(relayState);
|
||||||
if (deployment.getIDP().getSingleLogoutService().signResponse()) {
|
if (deployment.getIDP().getSingleLogoutService().signResponse()) {
|
||||||
|
if (deployment.getSignatureCanonicalizationMethod() != null)
|
||||||
|
binding.canonicalizationMethod(deployment.getSignatureCanonicalizationMethod());
|
||||||
binding.signatureAlgorithm(deployment.getSignatureAlgorithm())
|
binding.signatureAlgorithm(deployment.getSignatureAlgorithm())
|
||||||
.signWith(deployment.getSigningKeyPair())
|
.signWith(deployment.getSigningKeyPair())
|
||||||
.signDocument();
|
.signDocument();
|
||||||
if (deployment.getSignatureCanonicalizationMethod() != null)
|
|
||||||
binding.canonicalizationMethod(deployment.getSignatureCanonicalizationMethod());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -110,6 +110,9 @@ public class WebBrowserSsoAuthenticationHandler extends AbstractSamlAuthenticati
|
|||||||
.destination(deployment.getIDP().getSingleLogoutService().getRequestBindingUrl());
|
.destination(deployment.getIDP().getSingleLogoutService().getRequestBindingUrl());
|
||||||
BaseSAML2BindingBuilder binding = new BaseSAML2BindingBuilder();
|
BaseSAML2BindingBuilder binding = new BaseSAML2BindingBuilder();
|
||||||
if (deployment.getIDP().getSingleLogoutService().signRequest()) {
|
if (deployment.getIDP().getSingleLogoutService().signRequest()) {
|
||||||
|
if (deployment.getSignatureCanonicalizationMethod() != null)
|
||||||
|
binding.canonicalizationMethod(deployment.getSignatureCanonicalizationMethod());
|
||||||
|
binding.signatureAlgorithm(deployment.getSignatureAlgorithm());
|
||||||
binding.signWith(deployment.getSigningKeyPair())
|
binding.signWith(deployment.getSigningKeyPair())
|
||||||
.signDocument();
|
.signDocument();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,6 +112,7 @@
|
|||||||
<xs:complexType name="sign-on-type">
|
<xs:complexType name="sign-on-type">
|
||||||
<xs:attribute name="signRequest" type="xs:boolean" use="optional"/>
|
<xs:attribute name="signRequest" type="xs:boolean" use="optional"/>
|
||||||
<xs:attribute name="validateResponseSignature" type="xs:boolean" use="optional"/>
|
<xs:attribute name="validateResponseSignature" type="xs:boolean" use="optional"/>
|
||||||
|
<xs:attribute name="validateAssertionSignature" type="xs:boolean" use="optional"/>
|
||||||
<xs:attribute name="requestBinding" type="xs:string" use="optional"/>
|
<xs:attribute name="requestBinding" type="xs:string" use="optional"/>
|
||||||
<xs:attribute name="responseBinding" type="xs:string" use="optional"/>
|
<xs:attribute name="responseBinding" type="xs:string" use="optional"/>
|
||||||
<xs:attribute name="bindingUrl" type="xs:string" use="optional"/>
|
<xs:attribute name="bindingUrl" type="xs:string" use="optional"/>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../../pom.xml</relativePath>
|
<relativePath>../../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -60,6 +60,10 @@
|
|||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-saml-core</artifactId>
|
<artifactId>keycloak-saml-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||||
|
|||||||
-2
@@ -27,10 +27,8 @@ import org.eclipse.jetty.security.authentication.FormAuthenticator;
|
|||||||
import org.eclipse.jetty.security.authentication.LoginAuthenticator;
|
import org.eclipse.jetty.security.authentication.LoginAuthenticator;
|
||||||
import org.eclipse.jetty.server.Authentication;
|
import org.eclipse.jetty.server.Authentication;
|
||||||
import org.eclipse.jetty.server.Request;
|
import org.eclipse.jetty.server.Request;
|
||||||
import org.eclipse.jetty.server.Response;
|
|
||||||
import org.eclipse.jetty.server.UserIdentity;
|
import org.eclipse.jetty.server.UserIdentity;
|
||||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||||
import org.eclipse.jetty.util.URIUtil;
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
import org.keycloak.adapters.saml.SamlSessionStore;
|
import org.keycloak.adapters.saml.SamlSessionStore;
|
||||||
import org.keycloak.adapters.saml.profile.SamlAuthenticationHandler;
|
import org.keycloak.adapters.saml.profile.SamlAuthenticationHandler;
|
||||||
|
|||||||
-1
@@ -28,7 +28,6 @@ import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement;
|
|||||||
import org.keycloak.adapters.saml.SamlSession;
|
import org.keycloak.adapters.saml.SamlSession;
|
||||||
import org.keycloak.adapters.saml.SamlSessionStore;
|
import org.keycloak.adapters.saml.SamlSessionStore;
|
||||||
import org.keycloak.common.util.KeycloakUriBuilder;
|
import org.keycloak.common.util.KeycloakUriBuilder;
|
||||||
import org.keycloak.dom.saml.v2.protocol.StatusType;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../../pom.xml</relativePath>
|
<relativePath>../../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -51,6 +51,10 @@
|
|||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-common</artifactId>
|
<artifactId>keycloak-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../../pom.xml</relativePath>
|
<relativePath>../../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -52,6 +52,10 @@
|
|||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-common</artifactId>
|
<artifactId>keycloak-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../../pom.xml</relativePath>
|
<relativePath>../../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -56,6 +56,10 @@
|
|||||||
<groupId>org.bouncycastle</groupId>
|
<groupId>org.bouncycastle</groupId>
|
||||||
<artifactId>bcprov-jdk15on</artifactId>
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<name>Keycloak SAML Jetty Integration</name>
|
<name>Keycloak SAML Jetty Integration</name>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<name>Keycloak SAML Client Adapter Modules</name>
|
<name>Keycloak SAML Client Adapter Modules</name>
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
<module>core-public</module>
|
||||||
<module>core</module>
|
<module>core</module>
|
||||||
<module>undertow</module>
|
<module>undertow</module>
|
||||||
<module>tomcat</module>
|
<module>tomcat</module>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-common</artifactId>
|
<artifactId>keycloak-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-adapter-spi</artifactId>
|
<artifactId>keycloak-adapter-spi</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
@@ -55,7 +55,11 @@
|
|||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-saml-core</artifactId>
|
<artifactId>keycloak-saml-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|||||||
-1
@@ -26,7 +26,6 @@ import org.keycloak.adapters.saml.SamlSession;
|
|||||||
import org.keycloak.adapters.saml.SamlSessionStore;
|
import org.keycloak.adapters.saml.SamlSessionStore;
|
||||||
import org.keycloak.adapters.servlet.FilterSessionStore;
|
import org.keycloak.adapters.servlet.FilterSessionStore;
|
||||||
import org.keycloak.common.util.KeycloakUriBuilder;
|
import org.keycloak.common.util.KeycloakUriBuilder;
|
||||||
import org.keycloak.dom.saml.v2.protocol.StatusType;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletRequestWrapper;
|
import javax.servlet.http.HttpServletRequestWrapper;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<name>Keycloak SAML Tomcat Integration</name>
|
<name>Keycloak SAML Tomcat Integration</name>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
|
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-common</artifactId>
|
<artifactId>keycloak-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-adapter-spi</artifactId>
|
<artifactId>keycloak-adapter-spi</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
@@ -65,7 +65,11 @@
|
|||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-saml-core</artifactId>
|
<artifactId>keycloak-saml-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|||||||
-3
@@ -27,10 +27,7 @@ import org.keycloak.adapters.spi.SessionIdMapper;
|
|||||||
import org.keycloak.adapters.tomcat.CatalinaUserSessionManagement;
|
import org.keycloak.adapters.tomcat.CatalinaUserSessionManagement;
|
||||||
import org.keycloak.adapters.tomcat.GenericPrincipalFactory;
|
import org.keycloak.adapters.tomcat.GenericPrincipalFactory;
|
||||||
import org.keycloak.common.util.KeycloakUriBuilder;
|
import org.keycloak.common.util.KeycloakUriBuilder;
|
||||||
import org.keycloak.dom.saml.v2.protocol.StatusResponseType;
|
|
||||||
import org.keycloak.dom.saml.v2.protocol.StatusType;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
|
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
|
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
|
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -52,6 +52,11 @@
|
|||||||
<artifactId>keycloak-common</artifactId>
|
<artifactId>keycloak-common</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<name>Keycloak SAML Wildfly Integration</name>
|
<name>Keycloak SAML Wildfly Integration</name>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../../pom.xml</relativePath>
|
<relativePath>../../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -45,6 +45,10 @@
|
|||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-adapter-spi</artifactId>
|
<artifactId>keycloak-adapter-spi</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../../pom.xml</relativePath>
|
<relativePath>../../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
+2
@@ -45,6 +45,7 @@ public class Constants {
|
|||||||
static final String KEY_STORE = "KeyStore";
|
static final String KEY_STORE = "KeyStore";
|
||||||
static final String SIGN_REQUEST = "signRequest";
|
static final String SIGN_REQUEST = "signRequest";
|
||||||
static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature";
|
static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature";
|
||||||
|
static final String VALIDATE_ASSERTION_SIGNATURE = "validateAssertionSignature";
|
||||||
static final String REQUEST_BINDING = "requestBinding";
|
static final String REQUEST_BINDING = "requestBinding";
|
||||||
static final String BINDING_URL = "bindingUrl";
|
static final String BINDING_URL = "bindingUrl";
|
||||||
static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature";
|
static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature";
|
||||||
@@ -97,6 +98,7 @@ public class Constants {
|
|||||||
static final String CERTIFICATE_ALIAS = "alias";
|
static final String CERTIFICATE_ALIAS = "alias";
|
||||||
static final String SIGN_REQUEST = "signRequest";
|
static final String SIGN_REQUEST = "signRequest";
|
||||||
static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature";
|
static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature";
|
||||||
|
static final String VALIDATE_ASSERTION_SIGNATURE = "validateAssertionSignature";
|
||||||
static final String REQUEST_BINDING = "requestBinding";
|
static final String REQUEST_BINDING = "requestBinding";
|
||||||
static final String BINDING_URL = "bindingUrl";
|
static final String BINDING_URL = "bindingUrl";
|
||||||
static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature";
|
static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature";
|
||||||
|
|||||||
+2
@@ -37,6 +37,7 @@ import org.jboss.modules.ModuleLoader;
|
|||||||
public abstract class KeycloakDependencyProcessor implements DeploymentUnitProcessor {
|
public abstract class KeycloakDependencyProcessor implements DeploymentUnitProcessor {
|
||||||
|
|
||||||
private static final ModuleIdentifier KEYCLOAK_JBOSS_CORE_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-jboss-adapter-core");
|
private static final ModuleIdentifier KEYCLOAK_JBOSS_CORE_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-jboss-adapter-core");
|
||||||
|
private static final ModuleIdentifier KEYCLOAK_API_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-saml-adapter-api-public");
|
||||||
private static final ModuleIdentifier KEYCLOAK_CORE_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-saml-adapter-core");
|
private static final ModuleIdentifier KEYCLOAK_CORE_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-saml-adapter-core");
|
||||||
private static final ModuleIdentifier KEYCLOAK_COMMON = ModuleIdentifier.create("org.keycloak.keycloak-common");
|
private static final ModuleIdentifier KEYCLOAK_COMMON = ModuleIdentifier.create("org.keycloak.keycloak-common");
|
||||||
|
|
||||||
@@ -72,6 +73,7 @@ public abstract class KeycloakDependencyProcessor implements DeploymentUnitProce
|
|||||||
// ModuleDependency(ModuleLoader moduleLoader, ModuleIdentifier identifier, boolean optional, boolean export, boolean importServices, boolean userSpecified)
|
// ModuleDependency(ModuleLoader moduleLoader, ModuleIdentifier identifier, boolean optional, boolean export, boolean importServices, boolean userSpecified)
|
||||||
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_JBOSS_CORE_ADAPTER, false, false, false, false));
|
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_JBOSS_CORE_ADAPTER, false, false, false, false));
|
||||||
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_CORE_ADAPTER, false, false, false, false));
|
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_CORE_ADAPTER, false, false, false, false));
|
||||||
|
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_API_ADAPTER, false, false, false, false));
|
||||||
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_COMMON, false, false, false, false));
|
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_COMMON, false, false, false, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-1
@@ -37,6 +37,11 @@ abstract class SingleSignOnDefinition {
|
|||||||
.setXmlName(Constants.XML.VALIDATE_RESPONSE_SIGNATURE)
|
.setXmlName(Constants.XML.VALIDATE_RESPONSE_SIGNATURE)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
static final SimpleAttributeDefinition VALIDATE_ASSERTION_SIGNATURE =
|
||||||
|
new SimpleAttributeDefinitionBuilder(Constants.Model.VALIDATE_ASSERTION_SIGNATURE, ModelType.BOOLEAN, true)
|
||||||
|
.setXmlName(Constants.XML.VALIDATE_ASSERTION_SIGNATURE)
|
||||||
|
.build();
|
||||||
|
|
||||||
static final SimpleAttributeDefinition REQUEST_BINDING =
|
static final SimpleAttributeDefinition REQUEST_BINDING =
|
||||||
new SimpleAttributeDefinitionBuilder(Constants.Model.REQUEST_BINDING, ModelType.STRING, true)
|
new SimpleAttributeDefinitionBuilder(Constants.Model.REQUEST_BINDING, ModelType.STRING, true)
|
||||||
.setXmlName(Constants.XML.REQUEST_BINDING)
|
.setXmlName(Constants.XML.REQUEST_BINDING)
|
||||||
@@ -52,7 +57,7 @@ abstract class SingleSignOnDefinition {
|
|||||||
.setXmlName(Constants.XML.BINDING_URL)
|
.setXmlName(Constants.XML.BINDING_URL)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGN_REQUEST, VALIDATE_RESPONSE_SIGNATURE, REQUEST_BINDING, RESPONSE_BINDING, BINDING_URL};
|
static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGN_REQUEST, VALIDATE_RESPONSE_SIGNATURE, VALIDATE_ASSERTION_SIGNATURE, REQUEST_BINDING, RESPONSE_BINDING, BINDING_URL};
|
||||||
|
|
||||||
static final HashMap<String, SimpleAttributeDefinition> ATTRIBUTE_MAP = new HashMap<>();
|
static final HashMap<String, SimpleAttributeDefinition> ATTRIBUTE_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
|||||||
+1
@@ -67,6 +67,7 @@ keycloak-saml.IDP.signatureCanonicalizationMethod=Signature canonicalization met
|
|||||||
keycloak-saml.IDP.SingleSignOnService=Single sign-on configuration
|
keycloak-saml.IDP.SingleSignOnService=Single sign-on configuration
|
||||||
keycloak-saml.IDP.SingleSignOnService.signRequest=Sign SSO requests
|
keycloak-saml.IDP.SingleSignOnService.signRequest=Sign SSO requests
|
||||||
keycloak-saml.IDP.SingleSignOnService.validateResponseSignature=Validate an SSO response signature
|
keycloak-saml.IDP.SingleSignOnService.validateResponseSignature=Validate an SSO response signature
|
||||||
|
keycloak-saml.IDP.SingleSignOnService.validateAssertionSignature=Validate an SSO assertion signature
|
||||||
keycloak-saml.IDP.SingleSignOnService.requestBinding=HTTP method to use for requests
|
keycloak-saml.IDP.SingleSignOnService.requestBinding=HTTP method to use for requests
|
||||||
keycloak-saml.IDP.SingleSignOnService.responseBinding=HTTP method to use for responses
|
keycloak-saml.IDP.SingleSignOnService.responseBinding=HTTP method to use for responses
|
||||||
keycloak-saml.IDP.SingleSignOnService.bindingUrl=SSO endpoint URL
|
keycloak-saml.IDP.SingleSignOnService.bindingUrl=SSO endpoint URL
|
||||||
|
|||||||
+5
@@ -132,6 +132,11 @@
|
|||||||
<xs:documentation>Validate the SSO response signature</xs:documentation>
|
<xs:documentation>Validate the SSO response signature</xs:documentation>
|
||||||
</xs:annotation>
|
</xs:annotation>
|
||||||
</xs:attribute>
|
</xs:attribute>
|
||||||
|
<xs:attribute name="validateAssertionSignature" type="xs:boolean" use="optional">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:documentation>Validate the SSO assertion signature</xs:documentation>
|
||||||
|
</xs:annotation>
|
||||||
|
</xs:attribute>
|
||||||
<xs:attribute name="requestBinding" type="xs:string" use="optional">
|
<xs:attribute name="requestBinding" type="xs:string" use="optional">
|
||||||
<xs:annotation>
|
<xs:annotation>
|
||||||
<xs:documentation>HTTP method to use for requests</xs:documentation>
|
<xs:documentation>HTTP method to use for requests</xs:documentation>
|
||||||
|
|||||||
+1
@@ -42,6 +42,7 @@
|
|||||||
<IDP entityID="idp" signaturesRequired="true" signatureAlgorithm="test" signatureCanonicalizationMethod="test" encryption="test">
|
<IDP entityID="idp" signaturesRequired="true" signatureAlgorithm="test" signatureCanonicalizationMethod="test" encryption="test">
|
||||||
<SingleSignOnService signRequest="true"
|
<SingleSignOnService signRequest="true"
|
||||||
validateResponseSignature="true"
|
validateResponseSignature="true"
|
||||||
|
validateAssertionSignature="true"
|
||||||
requestBinding="POST"
|
requestBinding="POST"
|
||||||
responseBinding="POST"
|
responseBinding="POST"
|
||||||
bindingUrl="http://localhost:8080/auth/realms/saml-demo/protocol/saml"/>
|
bindingUrl="http://localhost:8080/auth/realms/saml-demo/protocol/saml"/>
|
||||||
|
|||||||
+1
@@ -44,6 +44,7 @@
|
|||||||
<IDP entityID="idp" signaturesRequired="true" signatureAlgorithm="test" signatureCanonicalizationMethod="test">
|
<IDP entityID="idp" signaturesRequired="true" signatureAlgorithm="test" signatureCanonicalizationMethod="test">
|
||||||
<SingleSignOnService signRequest="true"
|
<SingleSignOnService signRequest="true"
|
||||||
validateResponseSignature="true"
|
validateResponseSignature="true"
|
||||||
|
validateAssertionSignature="true"
|
||||||
requestBinding="POST"
|
requestBinding="POST"
|
||||||
responseBinding="POST"
|
responseBinding="POST"
|
||||||
bindingUrl="http://localhost:8080/auth/realms/saml-demo/protocol/saml"/>
|
bindingUrl="http://localhost:8080/auth/realms/saml-demo/protocol/saml"/>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-parent</artifactId>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<version>1.9.2.Final-SNAPSHOT</version>
|
<version>1.9.5.Final</version>
|
||||||
<relativePath>../../../pom.xml</relativePath>
|
<relativePath>../../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
Loaded 100 of 1666 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user