KEYCLOAK-10807 Fix incorrect RS link on my resources page
This commit is contained in:
parent
f238c4b736
commit
2dceda3f50
3 changed files with 10 additions and 3 deletions
|
@ -42,6 +42,7 @@ import org.keycloak.models.RealmModel;
|
|||
import org.keycloak.models.UserModel;
|
||||
import org.keycloak.models.utils.ModelToRepresentation;
|
||||
import org.keycloak.representations.idm.authorization.ScopeRepresentation;
|
||||
import org.keycloak.services.util.ResolveRelative;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
|
||||
|
@ -380,6 +381,10 @@ public class AuthorizationBean {
|
|||
|
||||
return redirectUris.iterator().next();
|
||||
}
|
||||
|
||||
public String getBaseUri() {
|
||||
return ResolveRelative.resolveRelativeUri(null, clientModel.getRootUrl(), clientModel.getBaseUrl());
|
||||
}
|
||||
}
|
||||
|
||||
public class ManagedPermissionBean {
|
||||
|
|
|
@ -29,13 +29,15 @@ public class ResolveRelative {
|
|||
if (url == null || !url.startsWith("/")) return url;
|
||||
if (rootUrl != null) {
|
||||
return rootUrl + url;
|
||||
} else {
|
||||
} else if (requestUri != null) {
|
||||
UriBuilder builder = UriBuilder.fromPath(url).host(requestUri.getHost());
|
||||
builder.scheme(requestUri.getScheme());
|
||||
if (requestUri.getPort() != -1) {
|
||||
builder.port(requestUri.getPort());
|
||||
}
|
||||
return builder.build().toString();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -202,7 +202,7 @@
|
|||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="${resource.resourceServer.redirectUri}">${resource.resourceServer.name}</a>
|
||||
<a href="${resource.resourceServer.baseUri}">${resource.resourceServer.name}</a>
|
||||
</td>
|
||||
<td>
|
||||
<#if resource.shares?size != 0>
|
||||
|
@ -259,7 +259,7 @@
|
|||
<#if resource.owner.email??>${resource.owner.email}<#else>${resource.owner.username}</#if>
|
||||
</td>
|
||||
<td>
|
||||
<a href="${resource.resourceServer.redirectUri}">${resource.resourceServer.name}</a>
|
||||
<a href="${resource.resourceServer.baseUri}">${resource.resourceServer.name}</a>
|
||||
</td>
|
||||
<td>
|
||||
<#if resource.permissions?size != 0>
|
||||
|
|
Loading…
Reference in a new issue