<div dir="ltr"><div>Quick update - I did some further experiments with this...</div><div><br></div><div>I added /redirect path to the a org.keycloak.services.resources.RealmsResource</div><div>like: @Path(&quot;{realm}/{client-id}/redirect&quot;)</div><div>see code fragment below.</div><div><br></div><div>This allows keycloak to initiate a redirect to the browser with the actual</div><div>target url of the client. Other clients now only need to now the realm and clientId</div><div>to generate a link that eventually redirects to the target application.</div><div><br></div><div>Usage:</div><div>GET <a href="http://localhost:8081/auth/realms/master/launchpad/redirect">http://localhost:8081/auth/realms/master/launchpad/redirect</a> -&gt; 302 response with location: <a href="http://apps.corp.local/launchpad">http://apps.corp.local/launchpad</a></div><div><br></div><div>Any chance to get this in as a PR?</div><div><br></div><div>Cheers,</div><div>Thomas</div><div><br></div><div>    @GET</div><div>    @Path(&quot;{realm}/{client-id}/redirect&quot;)</div><div>    public Response getRedirect(final @PathParam(&quot;realm&quot;) String realmName, final @PathParam(&quot;client-id&quot;) String clientId) throws Exception{</div><div><br></div><div>        RealmModel realm = init(realmName);</div><div><br></div><div>        if (realm == null){</div><div>            return null;</div><div>        }</div><div><br></div><div>        ClientModel client = realm.getClientByClientId(clientId);</div><div><br></div><div>        if (client == null){</div><div>            return null;</div><div>        }</div><div><br></div><div>        if (client.getRootUrl() == null){</div><div>            return Response.temporaryRedirect(uriInfo.getAbsolutePathBuilder().replacePath(client.getBaseUrl()).build()).build();</div><div>        }</div><div><br></div><div>        return Response.temporaryRedirect(URI.create(client.getRootUrl() + client.getBaseUrl())).build();</div><div>    }</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-05 16:23 GMT+01:00 Thomas Darimont <span dir="ltr">&lt;<a href="mailto:thomas.darimont@googlemail.com" target="_blank">thomas.darimont@googlemail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Hello,</div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">2016-02-05 15:22 GMT+01:00 Thomas Raehalme <span dir="ltr">&lt;<a href="mailto:thomas.raehalme@aitiofinland.com" target="_blank">thomas.raehalme@aitiofinland.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I understand this as well, but it has not been uncommon to encounter a situation where the user needs to know where to go next, because Keycloak doesn&#39;t have a link available. </blockquote><div><br></div></span><div>with a redirect facility as outlined above - one could render a link to the &quot;$KEYCLOAK_BASE_URL/redirect&quot; or </div><div>lookup the &quot;default&quot; client in order to render the client base url link with a proper label (client name).</div><div><br></div><div>Cheers,</div><div>Thomas </div></div><br><br></div></div>
</blockquote></div><br></div>