Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
798f1cb
Set version to 11.0.0
keycloak-bot Jul 22, 2020
0f6dc45
KEYCLOAK-14828 Disable DTD for SAML XML parser
mhajas Jul 21, 2020
3ba9566
KEYCLOAK-14232 Add Referrer-Policy: no-referrer to each response from…
mhajas Jun 17, 2020
73b1620
fix: Fix regex replacement for underscore and minus in parseToken. Cl…
danmana Jul 28, 2020
c1bbd7c
[KEYCLOAK-14352] JavaScript injection vulnerability of Realm registra…
douglaspalmer Jun 16, 2020
2a4aff1
KEYCLOAK-14869: Fix nullpointer exception in FullNameLDAPStorageMapper
Martin-Idel-SI Jul 27, 2020
5431670
KEYCLOAK-14870: Fix bug where user is incorrectly imported
Martin-Idel-SI Jul 27, 2020
641d3c5
KEYCLOAK-14892 NullPointerException when group mappings for LDAP user…
mposolda Jul 28, 2020
b388988
KEYCLOAK-14996 Fix performance bottleneck in GroupLDAPStorageMapper.g…
mposolda Aug 18, 2020
be0e284
KEYCLOAK-15091 Fix issue with custom favicon.ico
stianst Aug 20, 2020
ebec28e
KEYCLOAK-15217 Revert accidentally removed changes from KEYCLOAK-14107
mhajas Aug 20, 2020
c740ec4
KEYCLOAK-15139 Backwards compatibility for LDAP Read-only mode with I…
mposolda Aug 19, 2020
bee4ca8
KEYCLOAK-14872 CL DoS
tkyjovsk Jun 25, 2020
68e2ac3
Set version to 11.0.1
keycloak-bot Aug 21, 2020
cfc0419
KEYCLOAK-15259 Avoid using "null" Origin header as a valid value
mhajas Aug 25, 2020
5f2837d
Set version to 11.0.2
keycloak-bot Aug 31, 2020
0a4bcca
KEYCLOAK-15012 Fix issue with folder theme provider
stianst Sep 9, 2020
d962340
KEYCLOAK-15584 User can manage resources with just "view-profile" rol…
vmuzikar Sep 16, 2020
6a3945c
KEYCLOAK-15722 KeycloakPromise sometimes doesn't work
vmuzikar Sep 25, 2020
c1130d2
KEYCLOAK-15460 Fix missing event types in SAML endpoint
Sep 15, 2020
b5d9013
KEYCLOAK-15590 Javascript adapter init() is throwing a promise error …
vmuzikar Sep 17, 2020
e40234d
KEYCLOAK-14969 Whitelist RefreshableKeycloakSecurityContext for Keycl…
mhajas Sep 24, 2020
f660adc
KEYCLOAK-15585 OIDC redirect_uri allows dangerous schemes resulting i…
vmuzikar Jul 20, 2020
da186af
Set version to 11.0.3
keycloak-bot Nov 5, 2020
a7a1b95
Add docker workflow (#1)
romge Dec 9, 2020
de3fcf5
KEYCLOAK-22 Add ACR and LOA processing (#2)
romge Dec 22, 2020
a45cbba
KEYCLOAK-23 Add LoaAuthenticator (#3)
romge Jan 11, 2021
f567388
Add ConditionalLoaAuthenticator (#4)
romge Jan 11, 2021
69fe010
KEYCLOAK-21 add LoA to ACR mapping (#5)
romge Jan 20, 2021
9caa9ef
KEYCLOAK-45 Full authentication if no ACR is requested
romge Jan 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
34 changes: 34 additions & 0 deletions .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Docker CI

on:
push:
branches:
- master

jobs:
build:
name: Build and push docker image
runs-on: ubuntu-latest
steps:
- name: Check out keycloak/keycloak-containers
uses: actions/checkout@v2
with:
repository: keycloak/keycloak-containers
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: primesign-services
password: ${{ secrets.CR_TOKEN }}
- name: Build docker image
uses: docker/build-push-action@v2
with:
context: server
file: server/Dockerfile
push: true
build-args: GIT_REPO=primesign/keycloak
cache-from: type=registry,ref=primesign/keycloak:latest
cache-to: type=inline
tags: ghcr.io/primesign/keycloak:latest
2 changes: 1 addition & 1 deletion adapters/oidc/adapter-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ protected boolean abortTokenResponse() {
return true;
}
// Don't allow a CORS request if we're not validating CORS requests.
if (!deployment.isCors() && facade.getRequest().getHeader(CorsHeaders.ORIGIN) != null) {
String origin = facade.getRequest().getHeader(CorsHeaders.ORIGIN);
if (!deployment.isCors() && origin != null && !origin.equals("null")) {
facade.getResponse().setStatus(200);
facade.getResponse().end();
return true;
Expand All @@ -101,6 +102,7 @@ protected boolean corsRequest() {
if (!deployment.isCors()) return false;
KeycloakSecurityContext securityContext = facade.getSecurityContext();
String origin = facade.getRequest().getHeader(CorsHeaders.ORIGIN);
origin = "null".equals(origin) ? null : origin;
String exposeHeaders = deployment.getCorsExposedHeaders();

if (deployment.getPolicyEnforcer() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ public boolean preflightCors() {
if (!facade.getRequest().getMethod().equalsIgnoreCase("OPTIONS")) {
return false;
}
if (facade.getRequest().getHeader(CorsHeaders.ORIGIN) == null) {
String origin = facade.getRequest().getHeader(CorsHeaders.ORIGIN);
if (origin == null || origin.equals("null")) {
log.debug("checkCorsPreflight: no origin header");
return false;
}
log.debug("Preflight request returning");
facade.getResponse().setStatus(200);
String origin = facade.getRequest().getHeader(CorsHeaders.ORIGIN);
facade.getResponse().setHeader(CorsHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, origin);
facade.getResponse().setHeader(CorsHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true");
String requestMethods = facade.getRequest().getHeader(CorsHeaders.ACCESS_CONTROL_REQUEST_METHOD);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
package org.keycloak.adapters;

import org.junit.Assert;
import org.junit.Test;
import org.keycloak.KeycloakPrincipal;
import org.keycloak.KeycloakSecurityContext;
import org.keycloak.jose.jws.JWSBuilder;
import org.keycloak.representations.AccessToken;
import org.keycloak.representations.IDToken;
import org.keycloak.representations.oidc.TokenMetadataRepresentation;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.security.KeyPair;
import java.security.KeyPairGenerator;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

Expand Down Expand Up @@ -39,4 +52,63 @@ public void sameIssuedAtAsNotBeforeIsActiveKEYCLOAK10013() {
token.issuedAt(5000);
assertTrue(sut.isActive());
}

private AccessToken createSimpleToken() {
AccessToken token = new AccessToken();
token.id("111");
token.issuer("http://localhost:8080/auth/acme");
token.addAccess("foo").addRole("admin");
token.addAccess("bar").addRole("user");
return token;
}

@Test
public void testSerialization() throws Exception {
AccessToken token = createSimpleToken();
IDToken idToken = new IDToken();

idToken.setEmail("joe@email.cz");

KeyPair keyPair = KeyPairGenerator.getInstance("RSA").generateKeyPair();

String encoded = new JWSBuilder()
.jsonContent(token)
.rsa256(keyPair.getPrivate());
String encodedIdToken = new JWSBuilder()
.jsonContent(idToken)
.rsa256(keyPair.getPrivate());

KeycloakDeployment keycloakDeployment = new KeycloakDeployment();
keycloakDeployment.setNotBefore(5000);

KeycloakSecurityContext ctx = new RefreshableKeycloakSecurityContext(keycloakDeployment,null, encoded, token,encodedIdToken, null, null);
KeycloakPrincipal principal = new KeycloakPrincipal("joe", ctx);

// Serialize
ByteArrayOutputStream bso = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bso);
oos.writeObject(principal);
oos.close();

// Deserialize
byte[] bytes = bso.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
ObjectInputStream ois = new ObjectInputStream(bis);
principal = (KeycloakPrincipal)ois.readObject();
ctx = principal.getKeycloakSecurityContext();
token = ctx.getToken();
idToken = ctx.getIdToken();

System.out.println("Size of serialized principal: " + bytes.length);

Assert.assertEquals(encoded, ctx.getTokenString());
Assert.assertEquals(encodedIdToken, ctx.getIdTokenString());
Assert.assertEquals("111", token.getId());
Assert.assertEquals("111", token.getId());
Assert.assertTrue(token.getResourceAccess("foo").isUserInRole("admin"));
Assert.assertTrue(token.getResourceAccess("bar").isUserInRole("user"));
Assert.assertEquals("joe@email.cz", idToken.getEmail());
Assert.assertEquals("acme", ctx.getRealm());
ois.close();
}
}
2 changes: 1 addition & 1 deletion adapters/oidc/as7-eap6/as7-adapter-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-as7-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/as7-eap6/as7-adapter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-as7-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/as7-eap6/as7-subsystem/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-as7-integration-pom</artifactId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/as7-eap6/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak AS7 / JBoss EAP 6 Integration</name>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/fuse7/camel-undertow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-fuse7-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/fuse7/jetty94/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-fuse7-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/fuse7/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/fuse7/tomcat8/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-fuse7-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/fuse7/undertow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-fuse7-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/installed/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/jaxrs-oauth-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/jetty/jetty-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/jetty/jetty9.2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/jetty/jetty9.3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/jetty/jetty9.4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/jetty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak Jetty Integration</name>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/js/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.3</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Loading