Hi Kristof,
There is probably more than one way to do this, but here's at least one thing you can try. I'm going to assume you are doing this at a SAML IDP and are looking for information on the SP-partner?
If so, consider using an Access Policy - this definitely has access to the SAML request via:
var protocolContextJSON = (function() {
var protocolContext = context.getProtocolContext();
var protocolContextReturn = {};
protocolContextReturn["request"] = "" + protocolContext.getAuthnRequest();
protocolContextReturn["FederationId"] = "" + protocolContext.getFederationId();
protocolContextReturn["PartnerId"] = "" + protocolContext.getPartnerId();
protocolContextReturn["FederationName"] = "" + protocolContext.getFederationName();
protocolContextReturn["PartnerName"] = "" + protocolContext.getPartnerName();
return protocolContextReturn;
})();
You can also access the current user's credential in the access policy. From that you could extract tagvalue_session_index. Eg:
var sessionindex = null;
var user = context.getUser();
if (user != null) {
sessionindex = user.getAttribute("tagvalue_session_index");
}
Using IDMappingExtCache, you can use the session index as the key, and store as the value whatever details you want from the authentication request.
Then later in your federation mapping rule you can retrieve those values (information about the SSO request) from IDMappingExtCache as the stsuu in the mapping rule will also contain the tagvalue_session_index.
Make sense?
------------------------------
Shane Weeden
IBM
------------------------------
Original Message:
Sent: Wed June 12, 2019 08:01 AM
From: Kristof Goossens
Subject: User mapping: access to SAML request?
Hi Community,
Migrating from TFIM to the federation module, I was wondering if there is a way to get hold of (in this case) a SAML request in the mapping module.
We used to use a custom user mapping module, where we had the full SAML request available. The user mapping script should connect to a (HTTP) microservice and indicate the providerId in order for the microservice to identify the right mapping policies etc.
Through the stsuu object, I can get the requestSecurityToken() that provides me with info on the ACSurl, ACSindex, nameid format, etc.
I noticed the providerId can be found in the value of the relaystate, but as the relaystate is pretty widely (mis-)used to contain information that is vital to the workflow's operation, I am not sure if I can rely on that value.
So the question is twofold: What is the best way to reliably get to the providerId in the usermapping module and/or (even better) is there a way to get to the full request?
Thx,
------------------------------
Kristof Goossens
------------------------------