Compare commits
286
Commits
2.1.0.CR1
...
1.9.2.Test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1f979d94b | ||
|
|
18cc0fdaf3 | ||
|
|
39c0dfeb8f | ||
|
|
524ae68224 | ||
|
|
e63726d51c | ||
|
|
29c839602f | ||
|
|
1e20cad2ae | ||
|
|
7feeca8273 | ||
|
|
9c8d9ceb28 | ||
|
|
07a7035398 | ||
|
|
6c2f8a8f65 | ||
|
|
d1bf3c3be6 | ||
|
|
edef864ffc | ||
|
|
3effc265c4 | ||
|
|
41775bf8ef | ||
|
|
6c2464e399 | ||
|
|
17a7d04de9 | ||
|
|
b630c5b447 | ||
|
|
ab69b98766 | ||
|
|
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>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
+1
-5
@@ -169,11 +169,7 @@ public class AdapterDeploymentContext {
|
||||
public void setAuthServerBaseUrl(String authServerBaseUrl) {
|
||||
this.authServerBaseUrl = authServerBaseUrl;
|
||||
KeycloakUriBuilder serverBuilder = KeycloakUriBuilder.fromUri(authServerBaseUrl);
|
||||
resolveBrowserUrls(serverBuilder);
|
||||
|
||||
if (delegate.getRelativeUrls() == RelativeUrlsUsed.ALL_REQUESTS) {
|
||||
resolveNonBrowserUrls(serverBuilder);
|
||||
}
|
||||
resolveUrls(serverBuilder);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,37 +38,6 @@ public class AdapterUtils {
|
||||
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) {
|
||||
Set<String> roles = null;
|
||||
AccessToken accessToken = session.getToken();
|
||||
|
||||
+7
-38
@@ -111,39 +111,17 @@ public class KeycloakDeployment {
|
||||
|
||||
public void setAuthServerBaseUrl(AdapterConfig config) {
|
||||
this.authServerBaseUrl = config.getAuthServerUrl();
|
||||
String authServerURLForBackendReqs = config.getAuthServerUrlForBackendRequests();
|
||||
if (authServerBaseUrl == null && authServerURLForBackendReqs == null) return;
|
||||
if (authServerBaseUrl == null) return;
|
||||
|
||||
URI authServerUri = null;
|
||||
if (authServerBaseUrl != null) {
|
||||
authServerUri = URI.create(authServerBaseUrl);
|
||||
}
|
||||
URI authServerUri = URI.create(authServerBaseUrl);
|
||||
|
||||
if (authServerUri == null || authServerUri.getHost() == null) {
|
||||
if (authServerURLForBackendReqs != null) {
|
||||
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;
|
||||
}
|
||||
if (authServerUri.getHost() == null) {
|
||||
relativeUrls = RelativeUrlsUsed.ALWAYS;
|
||||
} else {
|
||||
// We have absolute URI in config
|
||||
relativeUrls = RelativeUrlsUsed.NEVER;
|
||||
KeycloakUriBuilder serverBuilder = KeycloakUriBuilder.fromUri(authServerBaseUrl);
|
||||
resolveBrowserUrls(serverBuilder);
|
||||
|
||||
if (authServerURLForBackendReqs == null) {
|
||||
resolveNonBrowserUrls(serverBuilder);
|
||||
} else {
|
||||
serverBuilder = KeycloakUriBuilder.fromUri(authServerURLForBackendReqs);
|
||||
resolveNonBrowserUrls(serverBuilder);
|
||||
}
|
||||
resolveUrls(serverBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,23 +130,14 @@ public class KeycloakDeployment {
|
||||
/**
|
||||
* @param authUrlBuilder absolute URI
|
||||
*/
|
||||
protected void resolveBrowserUrls(KeycloakUriBuilder authUrlBuilder) {
|
||||
protected void resolveUrls(KeycloakUriBuilder authUrlBuilder) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("resolveBrowserUrls");
|
||||
log.debug("resolveUrls");
|
||||
}
|
||||
|
||||
String login = authUrlBuilder.clone().path(ServiceUrlConstants.AUTH_PATH).build(getRealm()).toString();
|
||||
authUrl = KeycloakUriBuilder.fromUri(login);
|
||||
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();
|
||||
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(ClientIdAndSecretCredentialsProvider.PROVIDER_ID, deployment.getClientAuthenticator().getId());
|
||||
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());
|
||||
assertTrue(deployment.isAlwaysRefreshToken());
|
||||
assertTrue(deployment.isRegisterNodeAtStartup());
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
"client-keystore": "classpath:/keystore.jks",
|
||||
"client-keystore-password": "storepass",
|
||||
"client-key-password": "keypass",
|
||||
"auth-server-url-for-backend-requests": "https://backend:8443/auth",
|
||||
"always-refresh-token": true,
|
||||
"register-node-at-startup": true,
|
||||
"register-node-period": 1000,
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-as7-integration-pom</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-as7-integration-pom</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-as7-integration-pom</artifactId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<name>Keycloak AS7 / JBoss EAP 6 Integration</name>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<name>Keycloak Jetty Integration</name>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -163,6 +163,8 @@
|
||||
}
|
||||
} else if (initOptions.onLoad) {
|
||||
onLoad();
|
||||
} else {
|
||||
initPromise.setSuccess();
|
||||
}
|
||||
} else {
|
||||
initPromise.setSuccess();
|
||||
@@ -190,7 +192,7 @@
|
||||
redirectUri += (redirectUri.indexOf('?') == -1 ? '?' : '&') + 'prompt=' + options.prompt;
|
||||
}
|
||||
|
||||
sessionStorage.oauthState = JSON.stringify({ state: state, nonce: nonce, redirectUri: encodeURIComponent(redirectUri) });
|
||||
localStorage.oauthState = JSON.stringify({ state: state, nonce: nonce, redirectUri: encodeURIComponent(redirectUri) });
|
||||
|
||||
var action = 'auth';
|
||||
if (options && options.action == 'register') {
|
||||
@@ -687,10 +689,10 @@
|
||||
function parseCallback(url) {
|
||||
var oauth = new CallbackParser(url, kc.responseMode).parseUri();
|
||||
|
||||
var sessionState = sessionStorage.oauthState && JSON.parse(sessionStorage.oauthState);
|
||||
var sessionState = localStorage.oauthState && JSON.parse(localStorage.oauthState);
|
||||
|
||||
if (sessionState && (oauth.code || oauth.error || oauth.access_token || oauth.id_token) && oauth.state && oauth.state == sessionState.state) {
|
||||
delete sessionStorage.oauthState;
|
||||
delete localStorage.oauthState;
|
||||
|
||||
oauth.redirectUri = sessionState.redirectUri;
|
||||
oauth.storedNonce = sessionState.nonce;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<name>Keycloak OIDC Client Adapter Modules</name>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
+9
-3
@@ -51,10 +51,16 @@ public class OIDCFilterSessionStore extends FilterSessionStore implements Adapte
|
||||
}
|
||||
|
||||
public HttpServletRequestWrapper buildWrapper() {
|
||||
HttpSession session = request.getSession();
|
||||
KeycloakAccount account = (KeycloakAccount)session.getAttribute(KeycloakAccount.class.getName());
|
||||
HttpSession session = request.getSession(false);
|
||||
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) {
|
||||
account = (KeycloakAccount)request.getAttribute(KeycloakAccount.class.getName());
|
||||
account = (KeycloakAccount) request.getAttribute(KeycloakAccount.class.getName());
|
||||
}
|
||||
return buildWrapper(session, account);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ public class ServletOAuthClientBuilderTest {
|
||||
public void testBuilder() {
|
||||
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://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());
|
||||
Assert.assertEquals("customer-portal", oauthClient.getClientId());
|
||||
Assert.assertEquals("234234-234234-234234", oauthClient.getCredentials().get(CredentialRepresentation.SECRET));
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
"connection-pool-size": 20,
|
||||
"disable-trust-manager": true,
|
||||
"allow-any-hostname": true,
|
||||
"auth-server-url-for-backend-requests": "https://backend:8443/auth",
|
||||
"always-refresh-token": true,
|
||||
"register-node-at-startup": true,
|
||||
"register-node-period": 1000,
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<name>Keycloak Tomcat Integration</name>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-tomcat-integration-pom</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -45,7 +45,7 @@
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-adapter-spi</artifactId>
|
||||
</dependency>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-tomcat-integration-pom</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-tomcat-integration-pom</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-tomcat-integration-pom</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<name>Keycloak WildFly Integration</name>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<name>Keycloak Integration</name>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-saml-eap-integration-pom</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -43,6 +43,10 @@
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-adapter-spi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<name>Keycloak SAML EAP Integration</name>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-eap-integration-pom</artifactId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
+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_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");
|
||||
|
||||
@Override
|
||||
@@ -70,6 +71,7 @@ public abstract class KeycloakDependencyProcessor implements DeploymentUnitProce
|
||||
private void addCommonModules(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader) {
|
||||
// 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_API_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));
|
||||
}
|
||||
|
||||
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.2.Test</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.dom.saml.v2.protocol.StatusResponseType;
|
||||
import org.keycloak.dom.saml.v2.protocol.StatusType;
|
||||
|
||||
/**
|
||||
* Object that describes the SAML error that happened.
|
||||
File renamed without changes.
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -35,6 +35,11 @@
|
||||
<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>
|
||||
@@ -45,6 +50,11 @@
|
||||
<artifactId>keycloak-adapter-spi</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<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.exceptions.ConfigurationException;
|
||||
import org.keycloak.saml.common.exceptions.ProcessingException;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.KeyPair;
|
||||
@@ -54,45 +53,8 @@ public abstract class AbstractInitiateLogin implements AuthChallenge {
|
||||
@Override
|
||||
public boolean challenge(HttpFacade httpFacade) {
|
||||
try {
|
||||
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());
|
||||
}
|
||||
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();
|
||||
}
|
||||
SAML2AuthnRequestBuilder authnRequestBuilder = buildSaml2AuthnRequestBuilder(deployment);
|
||||
BaseSAML2BindingBuilder binding = createSaml2Binding(deployment);
|
||||
sessionStore.saveRequest();
|
||||
|
||||
sendAuthnRequest(httpFacade, authnRequestBuilder, binding);
|
||||
@@ -103,6 +65,53 @@ public abstract class AbstractInitiateLogin implements AuthChallenge {
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -18,8 +18,6 @@
|
||||
package org.keycloak.adapters.saml;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
-1
@@ -25,7 +25,6 @@ import org.keycloak.saml.common.util.StaxParserUtil;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
import javax.xml.stream.XMLEventReader;
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
import javax.xml.stream.events.StartElement;
|
||||
|
||||
/**
|
||||
|
||||
-1
@@ -18,7 +18,6 @@
|
||||
package org.keycloak.adapters.saml.config.parsers;
|
||||
|
||||
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.parsers.AbstractParser;
|
||||
import org.keycloak.saml.common.util.StaxParserUtil;
|
||||
|
||||
-1
@@ -23,7 +23,6 @@ import org.keycloak.adapters.saml.SamlSessionStore;
|
||||
import org.keycloak.adapters.saml.profile.SamlInvocationContext;
|
||||
import org.keycloak.adapters.spi.AuthOutcome;
|
||||
import org.keycloak.adapters.spi.HttpFacade;
|
||||
import org.keycloak.saml.common.constants.GeneralConstants;
|
||||
|
||||
/**
|
||||
* @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.SamlDeployment;
|
||||
import org.keycloak.adapters.saml.SamlSessionStore;
|
||||
import org.keycloak.adapters.saml.profile.SamlInvocationContext;
|
||||
import org.keycloak.adapters.spi.AuthOutcome;
|
||||
import org.keycloak.adapters.spi.HttpFacade;
|
||||
import org.keycloak.saml.common.constants.GeneralConstants;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -60,6 +60,10 @@
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<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.server.Authentication;
|
||||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.server.Response;
|
||||
import org.eclipse.jetty.server.UserIdentity;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
import org.eclipse.jetty.util.URIUtil;
|
||||
import org.jboss.logging.Logger;
|
||||
import org.keycloak.adapters.saml.SamlSessionStore;
|
||||
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.SamlSessionStore;
|
||||
import org.keycloak.common.util.KeycloakUriBuilder;
|
||||
import org.keycloak.dom.saml.v2.protocol.StatusType;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -51,6 +51,10 @@
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -52,6 +52,10 @@
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -56,6 +56,10 @@
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15on</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<name>Keycloak SAML Jetty Integration</name>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<name>Keycloak SAML Client Adapter Modules</name>
|
||||
@@ -31,6 +31,7 @@
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>core-public</module>
|
||||
<module>core</module>
|
||||
<module>undertow</module>
|
||||
<module>tomcat</module>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -39,7 +39,7 @@
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-adapter-spi</artifactId>
|
||||
</dependency>
|
||||
@@ -55,7 +55,11 @@
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
-1
@@ -26,7 +26,6 @@ import org.keycloak.adapters.saml.SamlSession;
|
||||
import org.keycloak.adapters.saml.SamlSessionStore;
|
||||
import org.keycloak.adapters.servlet.FilterSessionStore;
|
||||
import org.keycloak.common.util.KeycloakUriBuilder;
|
||||
import org.keycloak.dom.saml.v2.protocol.StatusType;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<name>Keycloak SAML Tomcat Integration</name>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -45,7 +45,7 @@
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-adapter-spi</artifactId>
|
||||
</dependency>
|
||||
@@ -65,7 +65,11 @@
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
-3
@@ -27,10 +27,7 @@ import org.keycloak.adapters.spi.SessionIdMapper;
|
||||
import org.keycloak.adapters.tomcat.CatalinaUserSessionManagement;
|
||||
import org.keycloak.adapters.tomcat.GenericPrincipalFactory;
|
||||
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 java.io.IOException;
|
||||
import java.util.LinkedList;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -52,6 +52,11 @@
|
||||
<artifactId>keycloak-common</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<name>Keycloak SAML Wildfly Integration</name>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -45,6 +45,10 @@
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-adapter-spi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
+2
@@ -37,6 +37,7 @@ import org.jboss.modules.ModuleLoader;
|
||||
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_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_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)
|
||||
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_API_ADAPTER, false, false, false, false));
|
||||
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_COMMON, false, false, false, false));
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<name>Keycloak Client Adapter SPI Modules</name>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
+1
@@ -305,6 +305,7 @@ public class FilterSessionStore implements AdapterSessionStore {
|
||||
|
||||
@Override
|
||||
public Principal getUserPrincipal() {
|
||||
if (account == null) return null;
|
||||
return account.getPrincipal();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -41,7 +41,7 @@
|
||||
<artifactId>jboss-logging</artifactId>
|
||||
<version>${jboss.logging.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-adapter-spi</artifactId>
|
||||
</dependency>
|
||||
|
||||
+2
-2
@@ -71,9 +71,9 @@ public class CatalinaUserSessionManagement implements SessionListener {
|
||||
|
||||
protected void logoutSession(Session session) {
|
||||
try {
|
||||
session.expire();
|
||||
if (session != null) session.expire();
|
||||
} catch (Exception e) {
|
||||
log.warn("Session not present or already invalidated.", e);
|
||||
log.debug("Session not present or already invalidated.", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -25,29 +25,10 @@ public enum RelativeUrlsUsed {
|
||||
/**
|
||||
* Always use relative URI and resolve them later based on browser HTTP request
|
||||
*/
|
||||
ALL_REQUESTS,
|
||||
|
||||
/**
|
||||
* Use relative Uris just for browser requests and resolve those based on browser HTTP requests.
|
||||
* Backend request (like refresh token request, codeToToken request etc) will use the URI based on current hostname
|
||||
*/
|
||||
BROWSER_ONLY,
|
||||
ALWAYS,
|
||||
|
||||
/**
|
||||
* Relative Uri not used. Configuration contains absolute URI
|
||||
*/
|
||||
NEVER;
|
||||
|
||||
public boolean useRelative(boolean isBrowserReq) {
|
||||
switch (this) {
|
||||
case ALL_REQUESTS:
|
||||
return true;
|
||||
case NEVER:
|
||||
return false;
|
||||
case BROWSER_ONLY:
|
||||
return isBrowserReq;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -561,7 +561,7 @@ public class Base64
|
||||
while( raw.hasRemaining() ){
|
||||
int rem = Math.min(3,raw.remaining());
|
||||
raw.get(raw3,0,rem);
|
||||
Base64.encode3to4(enc4, raw3, rem, Base64.NO_OPTIONS );
|
||||
Base64.encode3to4(enc4, raw3, rem, Base64.NO_OPTIONS);
|
||||
encoded.put(enc4);
|
||||
} // end input remaining
|
||||
}
|
||||
@@ -1282,7 +1282,12 @@ public class Base64
|
||||
|
||||
} // end try
|
||||
catch( java.io.IOException e ) {
|
||||
e.printStackTrace();
|
||||
if (e.getMessage().equals("Unsupported compression method")) {
|
||||
System.out.println("Base64 decoding: Ignoring GZIP header and just returning originally-decoded bytes."); // Better to log as debug, but jboss logging not available in the module :/
|
||||
} else {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Just return originally-decoded bytes
|
||||
} // end catch
|
||||
finally {
|
||||
|
||||
@@ -30,6 +30,10 @@ public class Time {
|
||||
return ((int) (System.currentTimeMillis() / 1000)) + offset;
|
||||
}
|
||||
|
||||
public static long currentTimeMillis() {
|
||||
return System.currentTimeMillis() + (offset * 1000);
|
||||
}
|
||||
|
||||
public static Date toDate(int time) {
|
||||
return new Date(((long) time ) * 1000);
|
||||
}
|
||||
@@ -38,6 +42,10 @@ public class Time {
|
||||
return ((long) time) * 1000;
|
||||
}
|
||||
|
||||
public static int getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
public static void setOffset(int offset) {
|
||||
Time.offset = offset;
|
||||
}
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -46,6 +46,7 @@ public class RefreshToken extends AccessToken {
|
||||
this.issuedFor = token.issuedFor;
|
||||
this.sessionState = token.sessionState;
|
||||
this.nonce = token.nonce;
|
||||
this.audience = token.audience;
|
||||
if (token.realmAccess != null) {
|
||||
realmAccess = token.realmAccess.clone();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
"connection-pool-size",
|
||||
"allow-any-hostname", "disable-trust-manager", "truststore", "truststore-password",
|
||||
"client-keystore", "client-keystore-password", "client-key-password",
|
||||
"auth-server-url-for-backend-requests", "always-refresh-token",
|
||||
"always-refresh-token",
|
||||
"register-node-at-startup", "register-node-period", "token-store", "principal-attribute"
|
||||
})
|
||||
public class AdapterConfig extends BaseAdapterConfig {
|
||||
@@ -55,8 +55,6 @@ public class AdapterConfig extends BaseAdapterConfig {
|
||||
protected String clientKeyPassword;
|
||||
@JsonProperty("connection-pool-size")
|
||||
protected int connectionPoolSize = 20;
|
||||
@JsonProperty("auth-server-url-for-backend-requests")
|
||||
protected String authServerUrlForBackendRequests;
|
||||
@JsonProperty("always-refresh-token")
|
||||
protected boolean alwaysRefreshToken = false;
|
||||
@JsonProperty("register-node-at-startup")
|
||||
@@ -134,14 +132,6 @@ public class AdapterConfig extends BaseAdapterConfig {
|
||||
this.connectionPoolSize = connectionPoolSize;
|
||||
}
|
||||
|
||||
public String getAuthServerUrlForBackendRequests() {
|
||||
return authServerUrlForBackendRequests;
|
||||
}
|
||||
|
||||
public void setAuthServerUrlForBackendRequests(String authServerUrlForBackendRequests) {
|
||||
this.authServerUrlForBackendRequests = authServerUrlForBackendRequests;
|
||||
}
|
||||
|
||||
public boolean isAlwaysRefreshToken() {
|
||||
return alwaysRefreshToken;
|
||||
}
|
||||
|
||||
+8
-2
@@ -27,9 +27,17 @@ import java.util.Map;
|
||||
*/
|
||||
public class AuthenticatorConfigRepresentation implements Serializable {
|
||||
|
||||
private String id;
|
||||
private String alias;
|
||||
private Map<String, String> config = new HashMap<String, String>();
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAlias() {
|
||||
return alias;
|
||||
@@ -39,8 +47,6 @@ public class AuthenticatorConfigRepresentation implements Serializable {
|
||||
this.alias = alias;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Map<String, String> getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
@@ -105,4 +105,37 @@ public class EventRepresentation {
|
||||
public void setDetails(Map<String, String> details) {
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
EventRepresentation that = (EventRepresentation) o;
|
||||
|
||||
if (time != that.time) return false;
|
||||
if (type != null ? !type.equals(that.type) : that.type != null) return false;
|
||||
if (realmId != null ? !realmId.equals(that.realmId) : that.realmId != null) return false;
|
||||
if (clientId != null ? !clientId.equals(that.clientId) : that.clientId != null) return false;
|
||||
if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
|
||||
if (sessionId != null ? !sessionId.equals(that.sessionId) : that.sessionId != null) return false;
|
||||
if (ipAddress != null ? !ipAddress.equals(that.ipAddress) : that.ipAddress != null) return false;
|
||||
if (error != null ? !error.equals(that.error) : that.error != null) return false;
|
||||
return !(details != null ? !details.equals(that.details) : that.details != null);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = (int) (time ^ (time >>> 32));
|
||||
result = 31 * result + (type != null ? type.hashCode() : 0);
|
||||
result = 31 * result + (realmId != null ? realmId.hashCode() : 0);
|
||||
result = 31 * result + (clientId != null ? clientId.hashCode() : 0);
|
||||
result = 31 * result + (userId != null ? userId.hashCode() : 0);
|
||||
result = 31 * result + (sessionId != null ? sessionId.hashCode() : 0);
|
||||
result = 31 * result + (ipAddress != null ? ipAddress.hashCode() : 0);
|
||||
result = 31 * result + (error != null ? error.hashCode() : 0);
|
||||
result = 31 * result + (details != null ? details.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+14
-1
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
/**
|
||||
* Used for partial import of users, clients, roles, and identity providers.
|
||||
* Used for partial import of users, groups, clients, roles, and identity providers.
|
||||
*
|
||||
* @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc.
|
||||
*/
|
||||
@@ -32,6 +32,7 @@ public class PartialImportRepresentation {
|
||||
protected Policy policy = Policy.FAIL;
|
||||
protected String ifResourceExists = "";
|
||||
protected List<UserRepresentation> users;
|
||||
protected List<GroupRepresentation> groups;
|
||||
protected List<ClientRepresentation> clients;
|
||||
protected List<IdentityProviderRepresentation> identityProviders;
|
||||
protected RolesRepresentation roles;
|
||||
@@ -40,6 +41,10 @@ public class PartialImportRepresentation {
|
||||
return (users != null) && !users.isEmpty();
|
||||
}
|
||||
|
||||
public boolean hasGroups() {
|
||||
return (groups != null) && !groups.isEmpty();
|
||||
}
|
||||
|
||||
public boolean hasClients() {
|
||||
return (clients != null) && !clients.isEmpty();
|
||||
}
|
||||
@@ -81,6 +86,14 @@ public class PartialImportRepresentation {
|
||||
return clients;
|
||||
}
|
||||
|
||||
public List<GroupRepresentation> getGroups() {
|
||||
return groups;
|
||||
}
|
||||
|
||||
public void setGroups(List<GroupRepresentation> groups) {
|
||||
this.groups = groups;
|
||||
}
|
||||
|
||||
public void setClients(List<ClientRepresentation> clients) {
|
||||
this.clients = clients;
|
||||
}
|
||||
|
||||
@@ -121,6 +121,8 @@ public class RealmRepresentation {
|
||||
protected String resetCredentialsFlow;
|
||||
protected String clientAuthenticationFlow;
|
||||
|
||||
protected String keycloakVersion;
|
||||
|
||||
@Deprecated
|
||||
protected Boolean social;
|
||||
@Deprecated
|
||||
@@ -814,6 +816,14 @@ public class RealmRepresentation {
|
||||
this.clientAuthenticationFlow = clientAuthenticationFlow;
|
||||
}
|
||||
|
||||
public String getKeycloakVersion() {
|
||||
return keycloakVersion;
|
||||
}
|
||||
|
||||
public void setKeycloakVersion(String keycloakVersion) {
|
||||
this.keycloakVersion = keycloakVersion;
|
||||
}
|
||||
|
||||
public List<GroupRepresentation> getGroups() {
|
||||
return groups;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
Vendored
+1
-1
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
Vendored
+1
-1
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}/unpacked</directory>
|
||||
<includes>
|
||||
<include>com/fasterxml/jackson/**</include>
|
||||
<include>org/bouncycastle/**</include>
|
||||
<include>org/keycloak/keycloak-common/**</include>
|
||||
<include>org/keycloak/keycloak-core/**</include>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<parent>
|
||||
<artifactId>keycloak-as7-eap6-adapter-dist-pom</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>1.9.2.Final-SNAPSHOT</version>
|
||||
<version>1.9.2.Test</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
Loaded 100 of 1255 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user