Package org.keycloak.url
Class HostnameV2Provider
java.lang.Object
org.keycloak.url.HostnameV2Provider
- All Implemented Interfaces:
Provider
,HostnameProvider
- Author:
- Vaclav Muzikar <vmuzikar@redhat.com>
-
Constructor Summary
ConstructorDescriptionHostnameV2Provider
(KeycloakSession session, String hostname, URI hostnameUrl, URI adminUrl, Boolean backchannelDynamic) -
Method Summary
Modifier and TypeMethodDescriptiongetContextPath
(jakarta.ws.rs.core.UriInfo originalUriInfo) Returns the context-path for Keycloak This is useful when Keycloak is exposed on a different context-path on a reverse proxy.getContextPath
(jakarta.ws.rs.core.UriInfo originalUriInfo, UrlType type) Returns the context-path for Keycloak.getHostname
(jakarta.ws.rs.core.UriInfo originalUriInfo) Returns the host.getHostname
(jakarta.ws.rs.core.UriInfo originalUriInfo, UrlType type) Returns the host.int
getPort
(jakarta.ws.rs.core.UriInfo originalUriInfo) Returns the port (or -1 for default port).int
Returns the port (or -1 for default port).getScheme
(jakarta.ws.rs.core.UriInfo originalUriInfo) Returns the URL scheme.Returns the URL scheme.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.urls.HostnameProvider
close
-
Constructor Details
-
HostnameV2Provider
public HostnameV2Provider(KeycloakSession session, String hostname, URI hostnameUrl, URI adminUrl, Boolean backchannelDynamic)
-
-
Method Details
-
getScheme
Description copied from interface:HostnameProvider
Returns the URL scheme. If not implemented will delegate toHostnameProvider.getScheme(UriInfo)
.- Specified by:
getScheme
in interfaceHostnameProvider
- Parameters:
originalUriInfo
- the original URItype
- type of the request- Returns:
- the schema
-
getScheme
Description copied from interface:HostnameProvider
Returns the URL scheme. If not implemented will get the scheme from the request.- Specified by:
getScheme
in interfaceHostnameProvider
- Parameters:
originalUriInfo
- the original URI- Returns:
- the schema
-
getHostname
Description copied from interface:HostnameProvider
Returns the host. If not implemented will delegate toHostnameProvider.getHostname(UriInfo)
.- Specified by:
getHostname
in interfaceHostnameProvider
- Parameters:
originalUriInfo
- the original URItype
- type of the request- Returns:
- the host
-
getHostname
Description copied from interface:HostnameProvider
Returns the host. If not implemented will get the host from the request.- Specified by:
getHostname
in interfaceHostnameProvider
- Returns:
- the host
-
getPort
Description copied from interface:HostnameProvider
Returns the port (or -1 for default port). If not implemented will delegate toHostnameProvider.getPort(UriInfo)
- Specified by:
getPort
in interfaceHostnameProvider
- Parameters:
originalUriInfo
- the original URItype
- type of the request- Returns:
- the port
-
getPort
public int getPort(jakarta.ws.rs.core.UriInfo originalUriInfo) Description copied from interface:HostnameProvider
Returns the port (or -1 for default port). If not implemented will get the port from the request.- Specified by:
getPort
in interfaceHostnameProvider
- Parameters:
originalUriInfo
- the original URI- Returns:
- the port
-
getContextPath
Description copied from interface:HostnameProvider
Returns the context-path for Keycloak. This is useful when Keycloak is exposed on a different context-path on a reverse proxy. If not implemented will delegate toHostnameProvider.getContextPath(UriInfo)
- Specified by:
getContextPath
in interfaceHostnameProvider
- Parameters:
originalUriInfo
- the original URItype
- type of the request- Returns:
- the context-path
-
getContextPath
Description copied from interface:HostnameProvider
Returns the context-path for Keycloak This is useful when Keycloak is exposed on a different context-path on a reverse proxy. If not implemented will use the context-path from the request, which by default is /auth- Specified by:
getContextPath
in interfaceHostnameProvider
- Parameters:
originalUriInfo
- the original URI- Returns:
- the context-path
-