Package org.keycloak.url
Class DefaultHostnameProvider
java.lang.Object
org.keycloak.url.DefaultHostnameProvider
- All Implemented Interfaces:
Provider,HostnameProvider
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultHostnameProvider(KeycloakSession session, URI frontendUri, URI adminUri, boolean forceBackendUrlToFrontendUrl) -
Method Summary
Modifier and TypeMethodDescriptiongetContextPath(jakarta.ws.rs.core.UriInfo originalUriInfo, UrlType type) Returns the context-path for Keycloak.getHostname(jakarta.ws.rs.core.UriInfo originalUriInfo, UrlType type) Returns the host.intReturns the port (or -1 for default port).Returns the URL scheme.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.urls.HostnameProvider
close, getContextPath, getHostname, getPort, getScheme
-
Constructor Details
-
DefaultHostnameProvider
public DefaultHostnameProvider(KeycloakSession session, URI frontendUri, URI adminUri, boolean forceBackendUrlToFrontendUrl)
-
-
Method Details
-
getScheme
Description copied from interface:HostnameProviderReturns the URL scheme. If not implemented will delegate toHostnameProvider.getScheme(UriInfo).- Specified by:
getSchemein interfaceHostnameProvider- Parameters:
originalUriInfo- the original URItype- type of the request- Returns:
- the schema
-
getHostname
Description copied from interface:HostnameProviderReturns the host. If not implemented will delegate toHostnameProvider.getHostname(UriInfo).- Specified by:
getHostnamein interfaceHostnameProvider- Parameters:
originalUriInfo- the original URItype- type of the request- Returns:
- the host
-
getPort
Description copied from interface:HostnameProviderReturns the port (or -1 for default port). If not implemented will delegate toHostnameProvider.getPort(UriInfo)- Specified by:
getPortin interfaceHostnameProvider- Parameters:
originalUriInfo- the original URItype- type of the request- Returns:
- the port
-
getContextPath
Description copied from interface:HostnameProviderReturns 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:
getContextPathin interfaceHostnameProvider- Parameters:
originalUriInfo- the original URItype- type of the request- Returns:
- the context-path
-