From 978207a1684951ed6b77ee740ea1be4ba228df02 Mon Sep 17 00:00:00 2001 From: jdotcms Date: Thu, 18 Jun 2020 14:42:56 -0600 Subject: [PATCH] #18699 instead of reading the hosts from all the api, it is just using a call to the WebLocator Web Api to retrieve the current host id --- build.gradle | 12 ++++++++++++ .../plugin/saml/v3/util/SiteIdpConfigResolver.java | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 build.gradle diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..bca6ea0 --- /dev/null +++ b/build.gradle @@ -0,0 +1,12 @@ +apply plugin: 'java' + +repositories { + maven { url "http://repo.dotcms.com/artifactory/libs-release" } +} + +dependencies { + compile('com.dotcms:dotcms:5.3.1') { transitive = true } + compile fileTree(dir: 'ROOT/dotserver/tomcat-8.5.32/webapps/ROOT/WEB-INF/lib', include: ['*.jar']) +} + +sourceSets.main.java.srcDirs += ['src'] diff --git a/src/com/dotcms/plugin/saml/v3/util/SiteIdpConfigResolver.java b/src/com/dotcms/plugin/saml/v3/util/SiteIdpConfigResolver.java index 89d3e8a..ddb8fdd 100644 --- a/src/com/dotcms/plugin/saml/v3/util/SiteIdpConfigResolver.java +++ b/src/com/dotcms/plugin/saml/v3/util/SiteIdpConfigResolver.java @@ -9,6 +9,7 @@ import com.dotmarketing.util.Logger; import com.dotmarketing.util.UtilMethods; import com.dotmarketing.util.json.JSONException; +import com.dotmarketing.business.web.WebAPILocator; import java.io.IOException; import java.io.Serializable; @@ -44,8 +45,8 @@ public static SiteIdpConfigResolver getInstance() */ public IdpConfig resolveIdpConfig( final HttpServletRequest request ) throws DotDataException, IOException, JSONException { - final String serverName = getHostId( request.getServerName() ); - return this.resolveIdpConfig( serverName ); + return this.resolveIdpConfig(WebAPILocator.getHostWebAPI() + .getCurrentHostNoThrow(request).getIdentifier()); } /*