From 4b09a4a2af2fffaca8de4d181eff47f105d7c4da Mon Sep 17 00:00:00 2001 From: stianst Date: Thu, 13 Feb 2020 15:08:40 +0100 Subject: [PATCH] KEYCLOAK-12993 AuthorizationBean invokes ResolveRelative.resolveRelativeUri with null as the value for KeycloakSession --- .../forms/account/freemarker/model/AuthorizationBean.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/src/main/java/org/keycloak/forms/account/freemarker/model/AuthorizationBean.java b/services/src/main/java/org/keycloak/forms/account/freemarker/model/AuthorizationBean.java index 0d14b219fc..f681cd3fd2 100755 --- a/services/src/main/java/org/keycloak/forms/account/freemarker/model/AuthorizationBean.java +++ b/services/src/main/java/org/keycloak/forms/account/freemarker/model/AuthorizationBean.java @@ -49,6 +49,7 @@ import org.keycloak.services.util.ResolveRelative; */ public class AuthorizationBean { + private final KeycloakSession session; private final UserModel user; private final AuthorizationProvider authorization; private final UriInfo uriInfo; @@ -59,6 +60,7 @@ public class AuthorizationBean { private Collection resourcesWaitingOthersApproval; public AuthorizationBean(KeycloakSession session, UserModel user, UriInfo uriInfo) { + this.session = session; this.user = user; this.uriInfo = uriInfo; authorization = session.getProvider(AuthorizationProvider.class); @@ -383,7 +385,7 @@ public class AuthorizationBean { } public String getBaseUri() { - return ResolveRelative.resolveRelativeUri(null, clientModel.getRootUrl(), clientModel.getBaseUrl()); + return ResolveRelative.resolveRelativeUri(session, clientModel.getRootUrl(), clientModel.getBaseUrl()); } }