org.wso2.carbon.webapp.mgt.sso

## Class SSOUtils

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

-     public class SSOUtils
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SSOUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
    `static String` | `generateIssuerID(String contextPath)`
    `static String` | `getSAMLSSOURLforApp(String requestURI, Properties ssoSPConfigProperties)`
    `static boolean` | `isSSOSPConfigExists()`
    `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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SSOUtils

          public SSOUtils()

  - ### Method Detail

    - #### 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:

Copyright © 2019 WSO2. All rights reserved.