Class HostnameV2Provider

java.lang.Object
org.keycloak.url.HostnameV2Provider
All Implemented Interfaces:
Provider, HostnameProvider

public class HostnameV2Provider extends Object implements HostnameProvider
Author:
Vaclav Muzikar <vmuzikar@redhat.com>
  • Constructor Details

  • Method Details

    • getScheme

      public String getScheme(jakarta.ws.rs.core.UriInfo originalUriInfo, UrlType type)
      Description copied from interface: HostnameProvider
      Returns the URL scheme. If not implemented will delegate to HostnameProvider.getScheme(UriInfo).
      Specified by:
      getScheme in interface HostnameProvider
      Parameters:
      originalUriInfo - the original URI
      type - type of the request
      Returns:
      the schema
    • getScheme

      public String getScheme(jakarta.ws.rs.core.UriInfo originalUriInfo)
      Description copied from interface: HostnameProvider
      Returns the URL scheme. If not implemented will get the scheme from the request.
      Specified by:
      getScheme in interface HostnameProvider
      Parameters:
      originalUriInfo - the original URI
      Returns:
      the schema
    • getHostname

      public String getHostname(jakarta.ws.rs.core.UriInfo originalUriInfo, UrlType type)
      Description copied from interface: HostnameProvider
      Returns the host. If not implemented will delegate to HostnameProvider.getHostname(UriInfo).
      Specified by:
      getHostname in interface HostnameProvider
      Parameters:
      originalUriInfo - the original URI
      type - type of the request
      Returns:
      the host
    • getHostname

      public String getHostname(jakarta.ws.rs.core.UriInfo originalUriInfo)
      Description copied from interface: HostnameProvider
      Returns the host. If not implemented will get the host from the request.
      Specified by:
      getHostname in interface HostnameProvider
      Returns:
      the host
    • getPort

      public int getPort(jakarta.ws.rs.core.UriInfo originalUriInfo, UrlType type)
      Description copied from interface: HostnameProvider
      Returns the port (or -1 for default port). If not implemented will delegate to HostnameProvider.getPort(UriInfo)
      Specified by:
      getPort in interface HostnameProvider
      Parameters:
      originalUriInfo - the original URI
      type - 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 interface HostnameProvider
      Parameters:
      originalUriInfo - the original URI
      Returns:
      the port
    • getContextPath

      public String getContextPath(jakarta.ws.rs.core.UriInfo originalUriInfo, UrlType type)
      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 to HostnameProvider.getContextPath(UriInfo)
      Specified by:
      getContextPath in interface HostnameProvider
      Parameters:
      originalUriInfo - the original URI
      type - type of the request
      Returns:
      the context-path
    • getContextPath

      public String getContextPath(jakarta.ws.rs.core.UriInfo originalUriInfo)
      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 interface HostnameProvider
      Parameters:
      originalUriInfo - the original URI
      Returns:
      the context-path