KEYCLOAK-2469 Minor changes
This commit is contained in:
parent
204d226267
commit
ce717fa20e
3 changed files with 15 additions and 10 deletions
|
@ -19,13 +19,13 @@
|
||||||
<title>Clients</title>
|
<title>Clients</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Keycloak provides support for managing OAuth clients.
|
Keycloak provides support for managing Clients.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<section id="client-config">
|
<section id="client-config">
|
||||||
<title>Client Config</title>
|
<title>Client Config</title>
|
||||||
<para>
|
<para>
|
||||||
Keycloak supports flexible configuration of OAuth Clients.
|
Keycloak supports flexible configuration of Clients.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
|
|
@ -116,7 +116,7 @@ public class RealmsResource {
|
||||||
* @param realmName
|
* @param realmName
|
||||||
* @param clientId
|
* @param clientId
|
||||||
* @return
|
* @return
|
||||||
* @since 1.9
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("{realm}/clients/{client_id}/redirect")
|
@Path("{realm}/clients/{client_id}/redirect")
|
||||||
|
@ -134,14 +134,19 @@ public class RealmsResource {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client.getRootUrl() == null) {
|
if (client.getRootUrl() == null && client.getBaseUrl() == null) {
|
||||||
|
return null;
|
||||||
URI targetUri = KeycloakUriBuilder.fromUri(ResolveRelative.resolveRelativeUri(uriInfo.getRequestUri(), client.getRootUrl(), client.getBaseUrl())).build();
|
|
||||||
|
|
||||||
return Response.temporaryRedirect(targetUri).build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response.temporaryRedirect(URI.create(client.getRootUrl() + client.getBaseUrl())).build();
|
|
||||||
|
URI targetUri;
|
||||||
|
if (client.getRootUrl() != null && (client.getBaseUrl() == null || client.getBaseUrl().isEmpty())) {
|
||||||
|
targetUri = KeycloakUriBuilder.fromUri(client.getRootUrl()).build();
|
||||||
|
} else {
|
||||||
|
targetUri = KeycloakUriBuilder.fromUri(ResolveRelative.resolveRelativeUri(uriInfo.getRequestUri(), client.getRootUrl(), client.getBaseUrl())).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Response.temporaryRedirect(targetUri).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Path("{realm}/login-actions")
|
@Path("{realm}/login-actions")
|
||||||
|
|
|
@ -17,7 +17,7 @@ import static org.junit.Assert.assertEquals;
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:thomas.darimont@gmail.com">Thomas Darimont</a>
|
* @author <a href="mailto:thomas.darimont@gmail.com">Thomas Darimont</a>
|
||||||
*/
|
*/
|
||||||
public class RealmResourceTest {
|
public class ClientRedirectTest {
|
||||||
|
|
||||||
@ClassRule
|
@ClassRule
|
||||||
public static KeycloakRule keycloakRule = new KeycloakRule(new KeycloakSetup() {
|
public static KeycloakRule keycloakRule = new KeycloakRule(new KeycloakSetup() {
|
Loading…
Reference in a new issue