Idira Identity: Different ACS url in one SAML app based on SAML request
81
Created On 11/10/26 10:59 AM - Last Modified 11/10/26 15:55 PM
Objective
For SP-initiated login flow with SAML, it is possible to have different ACS url values in the SAML response for one SAML app in admin portal, based on the attribute received from Service Provider(SP) in the SAML request. Note that this does not work for IDP-initiated login flow.
Environment
Identity App Access Service
Procedure
- In admin portal > SAML app > SAML Response tab, under the script editor, use the following script to set the "ServiceUrl" and the "HttpDestination" parameters:
if (!AssertionConsumerServiceIndex){
throw "AssertionConsumerServiceIndex is null, SP initiated SSO will fail";
}
// these options are copied from the SP metadata
var serviceUrlOptions = ["ACSURL1",
"ACSURL2"];
var serviceUrl; // the Url, determined by AssertionConsumerServiceIndex
switch (AssertionConsumerServiceIndex){
case 0:
serviceUrl = serviceUrlOptions[0];
break;
case 1:
serviceUrl = serviceUrlOptions[1];
break;
default:
throw "AssertionConsumerServiceIndex=" + AssertionConsumerServiceIndex + ", which is not valid";
}
setServiceUrl(serviceUrl);
setHttpDestination(serviceUrl);
Base on the "AssertionConsumerServiceIndex" attribute received in the SAML request during SP-initiated login flow, "ACSURL1" and "ACSURL2" will be used as the service url accordingly in the SAML response