diff --git a/src/main/java/com/amazon/redshift/plugin/SamlCredentialsProvider.java b/src/main/java/com/amazon/redshift/plugin/SamlCredentialsProvider.java index 3e1baf4..affbdc4 100755 --- a/src/main/java/com/amazon/redshift/plugin/SamlCredentialsProvider.java +++ b/src/main/java/com/amazon/redshift/plugin/SamlCredentialsProvider.java @@ -357,6 +357,14 @@ public void refresh() principal = entry.getValue(); } + // Set STS Regional Endpoint from SAML Assertion + List attributeValues = GetSAMLAttributeValues(xPath, doc, + "https://redshift.amazon.com/SAML/Attributes/StsEndpointUrl"); + if (!attributeValues.isEmpty() && m_stsEndpoint == null) + { + m_stsEndpoint = attributeValues.get(0); + } + AssumeRoleWithSAMLRequest samlRequest = new AssumeRoleWithSAMLRequest(); samlRequest.setSAMLAssertion(samlAssertion); samlRequest.setRoleArn(roleArn);