Class SSOUtils

java.lang.Object
org.wso2.carbon.webapp.mgt.sso.SSOUtils

public class SSOUtils extends Object
  • Constructor Details

    • SSOUtils

      public SSOUtils()
  • Method Details

    • isSSOSPConfigExists

      public static boolean isSSOSPConfigExists()
    • generateIssuerID

      public static String generateIssuerID(String contextPath)
    • getSAMLSSOURLforApp

      public static String getSAMLSSOURLforApp(String requestURI, Properties ssoSPConfigProperties)
    • generateConsumerUrl

      public static String generateConsumerUrl(org.apache.catalina.connector.Request request, Properties ssoSPConfigProperties)
      By default this method generates the ACS url based on the application server hostname + tenant.suffix. But, in case the request contains a custom HTTP header containing a different ACS url, this method will honor that url. (This kind of a scenario can happen when the end user is hoping to access a web application with a custom domain and URI through a router like Nginx.)
      Parameters:
      request - request object
      ssoSPConfigProperties - SSO properties loaded from server level sso-sp-config.properties file.
      Returns:
      appropriate ACS url
    • removeTenantFromURI

      public static String removeTenantFromURI(String uri, String customACSUrl, String tenantName)
      In case an end user wishes to access a web application from a custom domain without any tenant awareness by fronting the application server with a router like Nginx, we need to detect such a scenario and remove the tenant component from all redirect URIs during the SSO flow.
      Parameters:
      uri - original URI path
      customACSUrl - a custom HTTP header containing a different ACS url
      tenantName - Name of tenant that owns the web application.
      Returns: