Skip to content

Commit 642f0d3

Browse files
committed
URL-encode OIDC post_logout_uri query parameter
1 parent eedd893 commit 642f0d3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/CodeAuthenticationMechanism.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,8 +1134,8 @@ private String buildLogoutRedirectUri(TenantConfigContext configContext, String
11341134

11351135
if (configContext.oidcConfig.logout.postLogoutPath.isPresent()) {
11361136
logoutUri.append(AMP).append(configContext.oidcConfig.logout.getPostLogoutUriParam()).append(EQ).append(
1137-
buildUri(context, isForceHttps(configContext.oidcConfig),
1138-
configContext.oidcConfig.logout.postLogoutPath.get()));
1137+
OidcCommonUtils.urlEncode(buildUri(context, isForceHttps(configContext.oidcConfig),
1138+
configContext.oidcConfig.logout.postLogoutPath.get())));
11391139
logoutUri.append(AMP).append(OidcConstants.LOGOUT_STATE).append(EQ)
11401140
.append(generatePostLogoutState(context, configContext));
11411141
}

integration-tests/oidc-code-flow/src/main/java/io/quarkus/it/keycloak/TenantLogout.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ public String postLogout(@QueryParam("state") String postLogoutState) {
5050
if (!postLogoutState.equals(cookie.getValue())) {
5151
throw new InternalServerErrorException("'state' query parameter is not equal to the q_post_logout cookie value");
5252
}
53-
return "You were logged out";
53+
return "You were logged out, please login again";
5454
}
5555
}

integration-tests/oidc-code-flow/src/test/java/io/quarkus/it/keycloak/CodeFlowTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public void testRPInitiatedLogout() throws IOException {
444444
assertNotNull(getSessionCookie(webClient, "tenant-logout"));
445445

446446
page = webClient.getPage("http://localhost:8081/tenant-logout/logout");
447-
assertTrue(page.asNormalizedText().contains("You were logged out"));
447+
assertTrue(page.asNormalizedText().contains("You were logged out, please login again"));
448448
assertNull(getSessionCookie(webClient, "tenant-logout"));
449449

450450
page = webClient.getPage("http://localhost:8081/tenant-logout");

0 commit comments

Comments
 (0)