KEYCLOAK-2469 Minor changes

This commit is contained in:
Stian Thorgersen 2016-03-21 15:45:53 +01:00
parent 204d226267
commit ce717fa20e
3 changed files with 15 additions and 10 deletions

View file

@ -19,13 +19,13 @@
<title>Clients</title>
<para>
Keycloak provides support for managing OAuth clients.
Keycloak provides support for managing Clients.
</para>
<section id="client-config">
<title>Client Config</title>
<para>
Keycloak supports flexible configuration of OAuth Clients.
Keycloak supports flexible configuration of Clients.
</para>
<section>

View file

@ -116,7 +116,7 @@ public class RealmsResource {
* @param realmName
* @param clientId
* @return
* @since 1.9
* @since 2.0
*/
@GET
@Path("{realm}/clients/{client_id}/redirect")
@ -134,14 +134,19 @@ public class RealmsResource {
return null;
}
if (client.getRootUrl() == null) {
URI targetUri = KeycloakUriBuilder.fromUri(ResolveRelative.resolveRelativeUri(uriInfo.getRequestUri(), client.getRootUrl(), client.getBaseUrl())).build();
return Response.temporaryRedirect(targetUri).build();
if (client.getRootUrl() == null && client.getBaseUrl() == null) {
return null;
}
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")

View file

@ -17,7 +17,7 @@ import static org.junit.Assert.assertEquals;
/**
* @author <a href="mailto:thomas.darimont@gmail.com">Thomas Darimont</a>
*/
public class RealmResourceTest {
public class ClientRedirectTest {
@ClassRule
public static KeycloakRule keycloakRule = new KeycloakRule(new KeycloakSetup() {