KEYCLOAK-12993 AuthorizationBean invokes ResolveRelative.resolveRelativeUri with null as the value for KeycloakSession

This commit is contained in:
stianst 2020-02-13 15:08:40 +01:00 committed by Stian Thorgersen
parent 7efaf9869a
commit 4b09a4a2af

View file

@ -49,6 +49,7 @@ import org.keycloak.services.util.ResolveRelative;
*/ */
public class AuthorizationBean { public class AuthorizationBean {
private final KeycloakSession session;
private final UserModel user; private final UserModel user;
private final AuthorizationProvider authorization; private final AuthorizationProvider authorization;
private final UriInfo uriInfo; private final UriInfo uriInfo;
@ -59,6 +60,7 @@ public class AuthorizationBean {
private Collection<ResourceBean> resourcesWaitingOthersApproval; private Collection<ResourceBean> resourcesWaitingOthersApproval;
public AuthorizationBean(KeycloakSession session, UserModel user, UriInfo uriInfo) { public AuthorizationBean(KeycloakSession session, UserModel user, UriInfo uriInfo) {
this.session = session;
this.user = user; this.user = user;
this.uriInfo = uriInfo; this.uriInfo = uriInfo;
authorization = session.getProvider(AuthorizationProvider.class); authorization = session.getProvider(AuthorizationProvider.class);
@ -383,7 +385,7 @@ public class AuthorizationBean {
} }
public String getBaseUri() { public String getBaseUri() {
return ResolveRelative.resolveRelativeUri(null, clientModel.getRootUrl(), clientModel.getBaseUrl()); return ResolveRelative.resolveRelativeUri(session, clientModel.getRootUrl(), clientModel.getBaseUrl());
} }
} }