Package org.keycloak.url
Class DefaultHostnameProvider
- java.lang.Object
- 
- org.keycloak.url.DefaultHostnameProvider
 
- 
- All Implemented Interfaces:
- Provider,- HostnameProvider
 
 public class DefaultHostnameProvider extends Object implements HostnameProvider 
- 
- 
Constructor SummaryConstructors Constructor Description DefaultHostnameProvider(KeycloakSession session, URI frontendUri, URI adminUri, boolean forceBackendUrlToFrontendUrl)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetContextPath(javax.ws.rs.core.UriInfo originalUriInfo, UrlType type)Returns the context-path for Keycloak.StringgetHostname(javax.ws.rs.core.UriInfo originalUriInfo, UrlType type)Returns the host.intgetPort(javax.ws.rs.core.UriInfo originalUriInfo, UrlType type)Returns the port (or -1 for default port).StringgetScheme(javax.ws.rs.core.UriInfo originalUriInfo, UrlType type)Returns the URL scheme.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.keycloak.urls.HostnameProviderclose, getContextPath, getHostname, getPort, getScheme
 
- 
 
- 
- 
- 
Constructor Detail- 
DefaultHostnameProviderpublic DefaultHostnameProvider(KeycloakSession session, URI frontendUri, URI adminUri, boolean forceBackendUrlToFrontendUrl) 
 
- 
 - 
Method Detail- 
getSchemepublic String getScheme(javax.ws.rs.core.UriInfo originalUriInfo, UrlType type) Description copied from interface:HostnameProviderReturns the URL scheme. If not implemented will delegate toHostnameProvider.getScheme(UriInfo).- Specified by:
- getSchemein interface- HostnameProvider
- Parameters:
- originalUriInfo- the original URI
- type- type of the request
- Returns:
- the schema
 
 - 
getHostnamepublic String getHostname(javax.ws.rs.core.UriInfo originalUriInfo, UrlType type) Description copied from interface:HostnameProviderReturns the host. If not implemented will delegate toHostnameProvider.getHostname(UriInfo).- Specified by:
- getHostnamein interface- HostnameProvider
- Parameters:
- originalUriInfo- the original URI
- type- type of the request
- Returns:
- the host
 
 - 
getPortpublic int getPort(javax.ws.rs.core.UriInfo originalUriInfo, UrlType type)Description copied from interface:HostnameProviderReturns the port (or -1 for default port). If not implemented will delegate toHostnameProvider.getPort(UriInfo)- Specified by:
- getPortin interface- HostnameProvider
- Parameters:
- originalUriInfo- the original URI
- type- type of the request
- Returns:
- the port
 
 - 
getContextPathpublic String getContextPath(javax.ws.rs.core.UriInfo originalUriInfo, UrlType type) 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 interface- HostnameProvider
- Parameters:
- originalUriInfo- the original URI
- type- type of the request
- Returns:
- the context-path
 
 
- 
 
-