diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/CrossProtocolLogoutTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/CrossProtocolLogoutTestCase.java index 376a7653458..637a7cce2cc 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/CrossProtocolLogoutTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/CrossProtocolLogoutTestCase.java @@ -421,7 +421,6 @@ private HttpResponse sendSAMLMessage(String url, String samlMsgKey, String samlM HttpPost post = new HttpPost(url); post.setHeader(USER_AGENT, OAuth2Constant.USER_AGENT); urlParameters.add(new BasicNameValuePair(samlMsgKey, samlMsgValue)); - urlParameters.add(new BasicNameValuePair("tenantDomain", "carbon.super")); post.setEntity(new UrlEncodedFormEntity(urlParameters)); return client.execute(post); } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/EmailOTPTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/EmailOTPTestCase.java index ac8ef0d0699..57b771dbbf9 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/EmailOTPTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/EmailOTPTestCase.java @@ -106,7 +106,6 @@ public class EmailOTPTestCase extends ISIntegrationTest { CommonConstants.IS_DEFAULT_HTTPS_PORT + "/authenticationendpoint/email_otp.do"; private static final String USER_AGENT = "Apache-HttpClient/4.2.5 (java 1.5)"; private static final String profileName = "default"; - private static final String TENANT_DOMAIN_PARAM = "tenantDomain"; private Lookup cookieSpecRegistry; private RequestConfig requestConfig; @@ -225,10 +224,9 @@ private void deleteUser() { private HttpResponse sendSAMLMessage(String url, String samlMsgValue) throws IOException { List urlParameters = new ArrayList<>(); - HttpPost post = new HttpPost(url); + HttpPost post = new HttpPost(getTenantQualifiedURL(url, tenantInfo.getDomain())); post.setHeader("User-Agent", USER_AGENT); urlParameters.add(new BasicNameValuePair(CommonConstants.SAML_REQUEST_PARAM, samlMsgValue)); - urlParameters.add(new BasicNameValuePair(TENANT_DOMAIN_PARAM, config.getTenantDomain())); post.setEntity(new UrlEncodedFormEntity(urlParameters)); return httpClient.execute(post); } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/analytics/authentication/AbstractAnalyticsLoginTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/analytics/authentication/AbstractAnalyticsLoginTestCase.java index 24fa24d71e4..cf3c4c2498b 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/analytics/authentication/AbstractAnalyticsLoginTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/analytics/authentication/AbstractAnalyticsLoginTestCase.java @@ -63,7 +63,6 @@ public abstract class AbstractAnalyticsLoginTestCase extends ISIntegrationTest { private static final String INBOUND_AUTH_TYPE = "samlsso"; private static final String ATTRIBUTE_CS_INDEX_VALUE = "1239245949"; private static final String ATTRIBUTE_CS_INDEX_NAME = "attrConsumServiceIndex"; - private static final String TENANT_DOMAIN_PARAM = "tenantDomain"; private static final String SAML_SSO_URL = "https://localhost:9853/samlsso"; private static final String ACS_URL = "http://localhost:8490/%s/home.jsp"; @@ -390,12 +389,9 @@ private HttpResponse sendSAMLMessage(String url, String samlMsgKey, String samlM HttpClient httpClient = sharedHttpClient; List urlParameters = new ArrayList(); - HttpPost post = new HttpPost(url); + HttpPost post = new HttpPost(getTenantQualifiedURL(url, tenantInfo.getDomain())); post.setHeader("User-Agent", USER_AGENT); urlParameters.add(new BasicNameValuePair(samlMsgKey, samlMsgValue)); - if (config.getUserMode() == TestUserMode.TENANT_ADMIN || config.getUserMode() == TestUserMode.TENANT_USER) { - urlParameters.add(new BasicNameValuePair(TENANT_DOMAIN_PARAM, config.getUser().getTenantDomain())); - } post.setEntity(new UrlEncodedFormEntity(urlParameters)); return httpClient.execute(post); } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/consent/SelfSignUpConsentTest.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/consent/SelfSignUpConsentTest.java index 228d2ecb60e..5fab1055a4b 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/consent/SelfSignUpConsentTest.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/consent/SelfSignUpConsentTest.java @@ -69,7 +69,6 @@ public class SelfSignUpConsentTest extends ISIntegrationTest { private static final String COUNTRY_WSO2_CLAIM = "http://wso2.org/claims/country"; private static final String CALLBACK_QUERY_PARAM = "callback"; private static final String USERNAME_QUERY_PARAM = "username"; - private static final String TENANT_DOMAIN_QUERY_PARAM = "tenantDomain"; private static final String ADMIN = "admin"; private static final String EBONY = "ebony"; private static final String PASSWORD = "UsEr@123"; @@ -296,8 +295,7 @@ private String doCallSignUpDo(String username) throws IOException { username = MultitenantUtils.getTenantAwareUsername(username); } String selfRegisterEndpoint = - signupDoEndpoint + "?" + USERNAME_QUERY_PARAM + "=" + username + "&" + TENANT_DOMAIN_QUERY_PARAM + "=" - + tenantDomain; + signupDoEndpoint + "?" + USERNAME_QUERY_PARAM + "=" + username; HttpResponse httpResponse = sendGetRequest(client, selfRegisterEndpoint); return DataExtractUtil.getContentData(httpResponse); } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/idp/mgt/ResidentIDPConfigsTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/idp/mgt/ResidentIDPConfigsTestCase.java index e637f6b5111..33ed117f772 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/idp/mgt/ResidentIDPConfigsTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/idp/mgt/ResidentIDPConfigsTestCase.java @@ -144,13 +144,13 @@ public static Object[][] federatedAuthConfigURLProvider() { "Expected Passive STS URL is not found in the tenant mode"}, {"wso2.com", "OpenIdUrl", "https://localhost:9853/openidserver", "Expected OpenID Server URL is not found in the tenant mode"}, - {"wso2.com", "ECPUrl", "https://localhost:9853/samlecp?tenantDomain=wso2.com", + {"wso2.com", "ECPUrl", "https://localhost:9853/t/wso2.com/samlecp", "Expected ECP URL is not found in the tenant mode"}, - {"wso2.com", "LogoutReqUrl", "https://localhost:9853/samlsso?tenantDomain=wso2.com", + {"wso2.com", "LogoutReqUrl", "https://localhost:9853/t/wso2.com/samlsso", "Expected Logout URL is not found in the tenant mode"}, {"wso2.com", "ArtifactResolveUrl", "https://localhost:9853/samlartresolve", "Expected Artifact Resolution URL is not found in the tenant mode"}, - {"wso2.com", "SSOUrl", "https://localhost:9853/samlsso?tenantDomain=wso2.com", + {"wso2.com", "SSOUrl", "https://localhost:9853/t/wso2.com/samlsso", "Expected SSO URL is not found in the tenant mode"}, {"wso2.com", "IDENTITY_PROVIDER_URL", "https://localhost:9853/services/t/wso2.com/wso2carbon-sts", "Expected Security Token Service URL is not found in the tenant mode"}, diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oauth2/OAuth2ServiceSAML2BearerGrantTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oauth2/OAuth2ServiceSAML2BearerGrantTestCase.java index 67294f1455f..443b5dbd8ba 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oauth2/OAuth2ServiceSAML2BearerGrantTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oauth2/OAuth2ServiceSAML2BearerGrantTestCase.java @@ -85,7 +85,6 @@ public class OAuth2ServiceSAML2BearerGrantTestCase extends OAuth2ServiceAbstract private static final String COMMON_AUTH_URL = "https://localhost:9853/commonauth"; private static final String USER_AGENT = "Apache-HttpClient/4.2.5 (java 1.5)"; private static final String ACS_URL = "http://localhost:8490/%s/home.jsp"; - private static final String TENANT_DOMAIN_PARAM = "tenantDomain"; private static final String SAML_SSO_URL = "https://localhost:9853/samlsso"; private static final String ISSUER = "travelocity.com"; @@ -359,7 +358,6 @@ private HttpResponse sendSAMLRequest(String samlMsgValue) throws IOException { post.setHeader("User-Agent", USER_AGENT); urlParameters.add(new BasicNameValuePair(CommonConstants.SAML_REQUEST_PARAM, samlMsgValue)); - urlParameters.add(new BasicNameValuePair(TENANT_DOMAIN_PARAM, "carbon.super")); post.setEntity(new UrlEncodedFormEntity(urlParameters)); diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oidc/OIDCFederatedIdpInitLogoutTest.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oidc/OIDCFederatedIdpInitLogoutTest.java index 5127091d005..7492bcc49c8 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oidc/OIDCFederatedIdpInitLogoutTest.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oidc/OIDCFederatedIdpInitLogoutTest.java @@ -147,8 +147,6 @@ public class OIDCFederatedIdpInitLogoutTest extends AbstractIdentityFederationTe private static final String HTTPS_LOCALHOST_SERVICES = "https://localhost:%s/"; private static final String SAML_IDP_SLO_URL = SECONDARY_IS_SAML_SSO_URL + "?slo=true"; - private static final String TENANT_DOMAIN_PARAM = "tenantDomain"; - private SCIM2RestClient scim2RestClient; private String secondaryISClientID; private String secondaryISClientSecret; @@ -349,10 +347,9 @@ public HttpResponse sendSAMLMessage(String url, String samlMsgKey, String samlMs throws IOException { List urlParameters = new ArrayList<>(); - HttpPost post = new HttpPost(url); + HttpPost post = new HttpPost(getTenantQualifiedURL(url, tenantInfo.getDomain())); post.setHeader("User-Agent", USER_AGENT); urlParameters.add(new BasicNameValuePair(samlMsgKey, samlMsgValue)); - urlParameters.add(new BasicNameValuePair(TENANT_DOMAIN_PARAM, "carbon.super")); post.setEntity(new UrlEncodedFormEntity(urlParameters)); return client.execute(post); diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/postAuthnHandler/ChallengeQuestionPostAuthnHandlerTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/postAuthnHandler/ChallengeQuestionPostAuthnHandlerTestCase.java index cb2556e5a85..a68e5f1a509 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/postAuthnHandler/ChallengeQuestionPostAuthnHandlerTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/postAuthnHandler/ChallengeQuestionPostAuthnHandlerTestCase.java @@ -75,7 +75,6 @@ public class ChallengeQuestionPostAuthnHandlerTestCase extends ISIntegrationTest { - private static final String TENANT_DOMAIN_PARAM = "tenantDomain"; private static final Log log = LogFactory.getLog(ChallengeQuestionPostAuthnHandlerTestCase.class); // SAML Application attributes private static final String USER_AGENT = "Apache-HttpClient/4.2.5 (java 1.5)"; @@ -395,12 +394,9 @@ public void testLoginWithChallengeQuestions() { private HttpResponse sendSAMLMessage(String url, String samlMsgKey, String samlMsgValue, CloseableHttpClient httpClient) throws IOException { List urlParameters = new ArrayList(); - HttpPost post = new HttpPost(url); + HttpPost post = new HttpPost(getTenantQualifiedURL(url, tenantInfo.getDomain())); post.setHeader("User-Agent", USER_AGENT); urlParameters.add(new BasicNameValuePair(samlMsgKey, samlMsgValue)); - if (config.getUserMode() == TestUserMode.TENANT_ADMIN || config.getUserMode() == TestUserMode.TENANT_USER) { - urlParameters.add(new BasicNameValuePair(TENANT_DOMAIN_PARAM, config.getUser().getTenantDomain())); - } post.setEntity(new UrlEncodedFormEntity(urlParameters)); return httpClient.execute(post); } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/AbstractSAMLSSOTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/AbstractSAMLSSOTestCase.java index 00197168648..fde73f3e236 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/AbstractSAMLSSOTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/AbstractSAMLSSOTestCase.java @@ -84,7 +84,6 @@ public abstract class AbstractSAMLSSOTestCase extends ISIntegrationTest { private static final String INBOUND_AUTH_TYPE = "samlsso"; private static final String ATTRIBUTE_CS_INDEX_VALUE = "1239245949"; private static final String ATTRIBUTE_CS_INDEX_NAME = "attrConsumServiceIndex"; - public static final String TENANT_DOMAIN_PARAM = "tenantDomain"; protected static final String SAML = "saml"; protected static final String SAML_SSO_URL = "https://localhost:9853/samlsso"; protected static final String SAML_IDP_SLO_URL = SAML_SSO_URL + "?slo=true"; @@ -644,12 +643,9 @@ public HttpResponse sendSAMLMessage(String url, String samlMsgKey, String samlMs throws IOException { List urlParameters = new ArrayList(); - HttpPost post = new HttpPost(url); + HttpPost post = new HttpPost(getTenantQualifiedURL(url, tenantInfo.getDomain())); post.setHeader("User-Agent", USER_AGENT); urlParameters.add(new BasicNameValuePair(samlMsgKey, samlMsgValue)); - if (config.getUserMode() == TestUserMode.TENANT_ADMIN || config.getUserMode() == TestUserMode.TENANT_USER) { - urlParameters.add(new BasicNameValuePair(TENANT_DOMAIN_PARAM, config.getUser().getTenantDomain())); - } post.setEntity(new UrlEncodedFormEntity(urlParameters)); return httpClient.execute(post); diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/RegistryMountTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/RegistryMountTestCase.java index b8b99660ced..81cee405309 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/RegistryMountTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/RegistryMountTestCase.java @@ -76,7 +76,6 @@ public class RegistryMountTestCase extends ISIntegrationTest { private static final String USER_AGENT = "Apache-HttpClient/4.2.5 (java 1.5)"; private static final String APPLICATION_NAME = "SAML-SSO-TestApplication"; private static final String ATTRIBUTE_CS_INDEX_VALUE = "1239245949"; - private static final String TENANT_DOMAIN_PARAM = "tenantDomain"; private static final String ACS_URL = "http://localhost:8490/%s/home.jsp"; private static final String COMMON_AUTH_URL = "https://localhost:9853/commonauth"; @@ -214,10 +213,9 @@ private HttpResponse sendGetRequest(String url) throws Exception { private HttpResponse sendSAMLMessage(String url, String samlMsgKey, String samlMsgValue) throws IOException { List urlParameters = new ArrayList<>(); - HttpPost post = new HttpPost(url); + HttpPost post = new HttpPost(getTenantQualifiedURL(url, tenantInfo.getDomain())); post.setHeader("User-Agent", USER_AGENT); urlParameters.add(new BasicNameValuePair(samlMsgKey, samlMsgValue)); - urlParameters.add(new BasicNameValuePair(TENANT_DOMAIN_PARAM, TENANT_DOMAIN)); post.setEntity(new UrlEncodedFormEntity(urlParameters)); return httpClient.execute(post); diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLErrorResponseTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLErrorResponseTestCase.java index ac2f74f00dc..9334c3cabb4 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLErrorResponseTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLErrorResponseTestCase.java @@ -72,7 +72,6 @@ public class SAMLErrorResponseTestCase extends ISIntegrationTest { private static final String USER_AGENT = "Apache-HttpClient/4.2.5 (java 1.5)"; private static final String APPLICATION_NAME = "SAML-SSO-TestApplication"; private static final String ARTIFACT_ID = "travelocity.com"; - private static final String TENANT_DOMAIN_PARAM = "tenantDomain"; private static final String SAML_SSO_URL = "https://localhost:9853/samlsso"; private static final String ACS_URL = "http://localhost:8490/%s/home.jsp"; @@ -185,12 +184,11 @@ private void setSystemProperties() { private HttpResponse sendSAMLMessage(String url, Map parameters) throws Exception { List urlParameters = new ArrayList(); - HttpPost post = new HttpPost(url); + HttpPost post = new HttpPost(getTenantQualifiedURL(url, tenantInfo.getDomain())); post.setHeader("User-Agent", USER_AGENT); for (Map.Entry entry : parameters.entrySet()) { urlParameters.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); } - urlParameters.add(new BasicNameValuePair(TENANT_DOMAIN_PARAM, isServer.getSuperTenant().getDomain())); post.setEntity(new UrlEncodedFormEntity(urlParameters)); return httpClient.execute(post); } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLIdPInitiatedSSOTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLIdPInitiatedSSOTestCase.java index 42b7cf29797..61f27c4375e 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLIdPInitiatedSSOTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLIdPInitiatedSSOTestCase.java @@ -61,7 +61,7 @@ public class SAMLIdPInitiatedSSOTestCase extends AbstractSAMLSSOTestCase { private static final String IDP_INIT_SSO_URL = "https://localhost:%s/samlsso?spEntityID=%s"; private static final String IDP_INIT_SSO_TENANT_URL - = "https://localhost:%s/samlsso?tenantDomain=wso2.com&spEntityID=%s"; + = "https://localhost:%s/t/wso2.com/samlsso?spEntityID=%s"; private static final String SAML_SSO_URL = "https://localhost:%s/samlsso"; private static final String SP_ACS_URL = "http://localhost:8490/%s/home.jsp"; private HttpClient httpClient; diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLLocalAndOutboundAuthenticatorsTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLLocalAndOutboundAuthenticatorsTestCase.java index 4df43494e29..1a0064dde64 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLLocalAndOutboundAuthenticatorsTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLLocalAndOutboundAuthenticatorsTestCase.java @@ -77,7 +77,6 @@ public class SAMLLocalAndOutboundAuthenticatorsTestCase extends ISIntegrationTes private static final String CALLBACK_URL = "callbackUrl"; private static final String SAML_SSO_LOGIN_URL = "http://localhost:8490/%s/samlsso?SAML2.HTTPBinding=%s"; private static final String USER_AGENT = "Apache-HttpClient/4.2.5 (java 1.5)"; - public static final String TENANT_DOMAIN_PARAM = "tenantDomain"; private static final String SAML_SSO_URL = "https://localhost:" + CommonConstants.IS_DEFAULT_HTTPS_PORT + "/samlsso"; private static final String COMMON_AUTH_URL = "https://localhost:" + CommonConstants.IS_DEFAULT_HTTPS_PORT + @@ -283,8 +282,8 @@ public void testErrorCodeInRedirectUrl() throws Exception { String samlRequest = Utils.extractDataFromResponse(response, CommonConstants.SAML_REQUEST_PARAM, 5); Map paramters = new HashMap(); paramters.put(CommonConstants.SAML_REQUEST_PARAM, samlRequest); - response = Utils.sendSAMLMessage(SAML_SSO_URL, paramters, USER_AGENT, config.getUserMode(), - TENANT_DOMAIN_PARAM, config.getUser().getTenantDomain(), httpClient); + response = Utils.sendSAMLMessage(getTenantQualifiedURL(SAML_SSO_URL, config.getUser().getTenantDomain()) + , paramters, USER_AGENT, httpClient); EntityUtils.consume(response.getEntity()); response = Utils.sendRedirectRequest(response, USER_AGENT, ACS_URL, config.getApplication() .getArtifact(), httpClient); diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLMetadataTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLMetadataTestCase.java index bdd47492199..808a92f2f70 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLMetadataTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLMetadataTestCase.java @@ -41,7 +41,7 @@ public class SAMLMetadataTestCase extends ISIntegrationTest { "https://localhost:9853/t/wso2.com/identity/metadata/saml2"; private static final String SAML_METADATA_ENDPOINT_WITH_SUPER_TENANT_AS_PATH_PARAM = "https://localhost:9853/t/carbon.super/identity/metadata/saml2"; - private static final String SAML_SSO_ENDPOINT_TENANT = "https://localhost:9853/samlsso?tenantDomain=wso2.com"; + private static final String SAML_SSO_ENDPOINT_TENANT = "https://localhost:9853/t/wso2.com/samlsso"; private static final String SAML_SSO_ENDPOINT_SUPER_TENANT = "https://localhost:9853/samlsso"; private static final String SAMLARTRESOLVE_ENDPOINT = "https://localhost:9853/samlartresolve"; diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLSSOTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLSSOTestCase.java index 79d4f9a1fec..c0c1c06b211 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLSSOTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/saml/SAMLSSOTestCase.java @@ -236,8 +236,8 @@ public void testSAMLRelayStateDecode() throws Exception { Map paramters = new HashMap(); paramters.put(CommonConstants.SAML_REQUEST_PARAM, samlRequest); paramters.put("RelayState", relayState); - response = Utils.sendSAMLMessage(SAML_SSO_URL, paramters, USER_AGENT, config.getUserMode(), - TENANT_DOMAIN_PARAM, config.getUser().getTenantDomain(), httpClient); + response = Utils.sendSAMLMessage(getTenantQualifiedURL(SAML_SSO_URL, + config.getUser().getTenantDomain()), paramters, USER_AGENT, httpClient); EntityUtils.consume(response.getEntity()); response = Utils.sendRedirectRequest(response, USER_AGENT, ACS_URL, config.getApp().getArtifact(), httpClient); diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/sts/TestPassiveSTS.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/sts/TestPassiveSTS.java index 2de033c22ca..b68e653492c 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/sts/TestPassiveSTS.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/sts/TestPassiveSTS.java @@ -117,7 +117,7 @@ public void testInit() throws Exception { .setDefaultRequestConfig(requestConfig) .setDefaultCookieStore(cookieStore).build(); String isURL = backendURL.substring(0, backendURL.indexOf("services/")); - this.passiveStsURL = isURL + "passivests"; + this.passiveStsURL = getTenantQualifiedURL(isURL + "passivests", tenantDomain); setSystemProperties(); } @@ -195,7 +195,6 @@ public void testInvokePassiveSTSEndPoint() throws IOException { cookieStore.clear(); String passiveParams = "?wreply=" + PASSIVE_STS_SAMPLE_APP_URL + "&wtrealm=PassiveSTSSampleApp"; - passiveParams = appendTenantDomainQueryParam(passiveParams); HttpGet request = new HttpGet(this.passiveStsURL + passiveParams); HttpResponse response = client.execute(request); Assert.assertNotNull(response, "PassiveSTSSampleApp invoke response is null for tenant domain: " + @@ -258,7 +257,6 @@ public void testPassiveSAML2Assertion() throws Exception { + "%2Fwss%2Foasis-wss-saml-token-profile-1.1%23SAMLV2.0%3C%2Fwst%3ATokenType%3E%3C%2Fwst" + "%3ARequestSecurityToken%3E"; - passiveParams = appendTenantDomainQueryParam(passiveParams); HttpGet request = new HttpGet(this.passiveStsURL + passiveParams + wreqParam); HttpResponse response = client.execute(request); @@ -282,7 +280,6 @@ public void testPassiveSAML2AssertionWithoutWReply() throws Exception { + "%2Fwss%2Foasis-wss-saml-token-profile-1.1%23SAMLV2.0%3C%2Fwst%3ATokenType%3E%3C%2Fwst" + "%3ARequestSecurityToken%3E"; - passiveParams = appendTenantDomainQueryParam(passiveParams); HttpGet request = new HttpGet(this.passiveStsURL + passiveParams + wreqParam); HttpResponse response = client.execute(request); @@ -310,7 +307,6 @@ public void testPassiveSAML2AssertionForInvalidWReply() throws Exception { + "%2Fwss%2Foasis-wss-saml-token-profile-1.1%23SAMLV2.0%3C%2Fwst%3ATokenType%3E%3C%2Fwst" + "%3ARequestSecurityToken%3E"; - passiveParams = appendTenantDomainQueryParam(passiveParams); HttpGet request = new HttpGet(this.passiveStsURL + passiveParams + wreqParam); HttpResponse response = client.execute(request); @@ -340,7 +336,6 @@ public void testSessionHijacking() throws Exception { public void testSendLogoutRequest() throws Exception { String passiveParams = "?wa=wsignout1.0&wreply=" + PASSIVE_STS_SAMPLE_APP_URL + "&wtrealm=PassiveSTSSampleApp"; - passiveParams = appendTenantDomainQueryParam(passiveParams); HttpGet request = new HttpGet(this.passiveStsURL + passiveParams); HttpResponse response = client.execute(request); Assert.assertNotNull(response, "PassiveSTSSampleApp logout response is null for tenant domain: " + @@ -395,12 +390,4 @@ private boolean requestMissingClaims(HttpResponse response) { String redirectUrl = Utils.getRedirectUrl(response); return redirectUrl.contains("consent.do"); } - - private String appendTenantDomainQueryParam(String params) { - - if (!StringUtils.equals(tenantDomain, "carbon.super")) { - return params + "&tenantDomain=" + tenantDomain; - } - return params; - } } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/util/Utils.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/util/Utils.java index e86e504b64b..f76f036f1a3 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/util/Utils.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/util/Utils.java @@ -452,7 +452,7 @@ public static HttpResponse sendECPPostRequest(String url, String userAgent, Http return response; } - public static HttpResponse sendSAMLMessage(String url, Map parameters, String userAgent, TestUserMode userMode, String tenantDomainParam, String tenantDomain, HttpClient httpClient) throws IOException { + public static HttpResponse sendSAMLMessage(String url, Map parameters, String userAgent, HttpClient httpClient) throws IOException { List urlParameters = new ArrayList(); HttpPost post = new HttpPost(url); @@ -460,9 +460,6 @@ public static HttpResponse sendSAMLMessage(String url, Map param for (Map.Entry entry : parameters.entrySet()) { urlParameters.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); } - if (userMode == TestUserMode.TENANT_ADMIN || userMode == TestUserMode.TENANT_USER) { - urlParameters.add(new BasicNameValuePair(tenantDomainParam, tenantDomain)); - } post.setEntity(new UrlEncodedFormEntity(urlParameters)); return httpClient.execute(post); } diff --git a/modules/integration/tests-ui-integration/tests-ui/src/test/java/org/wso2/identity/ui/integration/test/email/template/EmailTemplateChangeUITest.java b/modules/integration/tests-ui-integration/tests-ui/src/test/java/org/wso2/identity/ui/integration/test/email/template/EmailTemplateChangeUITest.java index 5bcb8d78133..37f7a71cba8 100644 --- a/modules/integration/tests-ui-integration/tests-ui/src/test/java/org/wso2/identity/ui/integration/test/email/template/EmailTemplateChangeUITest.java +++ b/modules/integration/tests-ui-integration/tests-ui/src/test/java/org/wso2/identity/ui/integration/test/email/template/EmailTemplateChangeUITest.java @@ -32,7 +32,7 @@ public class EmailTemplateChangeUITest extends ISIntegrationUiBaseTest { private static final String TEST_EMAIL_TYPE_PASSWORD = "Ask Password"; - private static final String TEST_EMAIL_BODY_ASK_PASSWORD = "Hi {first-name}\n\n\"\n\nPlease change your password for the newly created account : {user-name}. Please click the link below to create the password.\n\nhttps://localhost:8443/InfoRecoverySample/infoRecover/verify?confirmation={confirmation-code}&userstoredomain={userstore-domain}&username={url:user-name}&tenantdomain={tenant-domain}\n\nIf clicking the link doesn't seem to work, you can copy and paste the\nlink into your browser's address window."; + private static final String TEST_EMAIL_BODY_ASK_PASSWORD = "Hi {first-name}\n\n\"\n\nPlease change your password for the newly created account : {user-name}. Please click the link below to create the password.\n\nhttps://localhost:8443/t/wso2.com/InfoRecoverySample/infoRecover/verify?confirmation={confirmation-code}&userstoredomain={userstore-domain}&username={url:user-name}\n\nIf clicking the link doesn't seem to work, you can copy and paste the\nlink into your browser's address window."; @Test public void testChangeTemplateBody() throws Exception {