keycloak-scim/server_admin/topics/clients/client-link.adoc

20 lines
835 B
Text
Raw Normal View History

2016-05-20 00:15:52 +00:00
2016-05-20 20:52:41 +00:00
=== Client Links
2016-05-20 00:15:52 +00:00
2016-05-20 20:52:41 +00:00
For scenarios where one wants to link from one client to another, {{book.project.name}} provides a special redirect endpoint: `/realms/realm_name/clients/\{client-id}/redirect`.
2016-05-20 00:15:52 +00:00
If a client accesses this endpoint via an `HTTP GET` request, {{book.project.name}} returns the configured base URL for the provided Client and Realm in the form of an `HTTP 307` (Temporary Redirect) via the response's `Location` header.
2016-05-20 00:15:52 +00:00
Thus, a client only needs to know the Realm name and the Client ID in order to link to them.
This indirection helps avoid hard-coding client base URLs.
As an example, given the realm `master` and the client-id `account`:
[source]
----
2016-05-20 20:52:41 +00:00
http://host:port/auth/realms/master/clients/account/redirect
2016-05-20 00:15:52 +00:00
----
2016-05-20 20:52:41 +00:00
Would temporarily redirect to: http://host:port/auth/realms/master/account
2016-05-20 00:15:52 +00:00