From 986b6af4f5589ec1577ccba9b1d71b5e189ba9e3 Mon Sep 17 00:00:00 2001 From: Pedro Igor Date: Tue, 2 Jan 2024 12:59:06 -0300 Subject: [PATCH] Make sure the context path from the base URI is respected when building TOTP URIs Closes #21542 Signed-off-by: Pedro Igor --- .../forms/login/freemarker/FreeMarkerLoginFormsProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java b/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java index 0322ed10b6..2a1e742a5d 100755 --- a/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java +++ b/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java @@ -317,7 +317,7 @@ public class FreeMarkerLoginFormsProvider implements LoginFormsProvider { */ private UriBuilder getTotpUriBuilder() { return uriInfo.getBaseUriBuilder() - .replacePath(uriInfo.getRequestUri().getPath()) + .path(uriInfo.getPath()) .replaceQuery(uriInfo.getRequestUri().getQuery()); }