Retrieving IDPEntry element from the SSORequest URI with SP-Initiated SSO

We receive a SP-initiated SSO call at our IDP

public ActionResult SsoService()
{
SAMLIdentityProvider.ReceiveSSO(Request, out var partnerSp);
return RedirectToAction(“SsoServicePostLogin”, new { partnerSp });
}

The Service provider sends us the following data in the SAML


<saml2p:AuthnRequest
… … … … … … … … … … … … …
saml2p:Scoping
saml2p:IDPList
<saml2p:IDPEntry ProviderID=“XYZ”/>
</saml2p:IDPList>
saml2p:RequesterID<a href=“https://www.componentspace.com</saml2p:RequesterID>”>https://www.componentspace.com</saml2p:RequesterID>
</saml2p:Scoping>
</saml2p:AuthnRequest>

We need the value of the ProviderID attribute. How can we achieve this with componentspace components.

The following code retrieves it, but I don’t know if this is the right approach.

public ActionResult SsoService([FromBody] string samlrequest)
{
var xmlElement = ComponentSpace.SAML2.Utility.SAML.FromBase64String(samlrequest);
var authn = new AuthnRequest(xmlElement);
var iDPEntry = authn.Scoping.IDPList.IDPEntries.FirstOrDefault();

SAMLIdentityProvider.ReceiveSSO(Request, out var partnerSp);
return RedirectToAction(“SsoServicePostLogin”, new { partnerSp });
}


Thanks in advance,

RB

We’ll look at making this easier to achieve.
Please contact us at support@componentspace.com mentioning your forum post and also what version of the product you’re using.