Hello Stuart,
thanks for your help :)
My current understanding is that I need to proxy requests that are sent to a virtual host created
at runtime by the Keycloak deployment and Keycloak would add some additional headers with auth information
and takes care of authentication of necessary.
Since this can be configured at runtime I don't see how I could use the ServletExtension (which is to my knowledge
applied at start-time) to dynamically register virtual hosts with Undertow.
The workflow is as follows:
So an admin would create a new "proxied" client configuration in the Keycloak admin console where
he would configure the name for a new virtual host and a target url.
E.g. if the keycloak servername is "
sso.acme.com" a user would create proxied client with the following configuration:
* clientid: app1
* Header Mapping: key value pairs with header name to (dynamic) expression mapping to inject in the proxied request
* Certificate / public / private key
The certificate is used to provide TLS for
app1.acme.com - one could also use a wildcard cert here or generate
the cert on the server on client setup.
The servlet based approach could be done easily done with Servlets or JAX-RS endpoints, but I still wonder how the dynamic vhost registration could be done.
Cheers,
Thomas