Saml2ClaimTypes is hardcoded for NameId,NameIdFormat,SessionIndex

Viewed 81

I tried to send logout request to IDP using Saml2LogoutRequest . It is reading the claim value from the principal which we are passing as params . But in the code , they are reading the claim values based on the hardcoded values of itfoxtec whereas we have our own claim name type and name id type. How to resolve this ?

enter image description here

enter image description here

1 Answers

You can use the Saml2LogoutRequest constructor without the ClaimsPrincipal parameter. After creation the Saml2LogoutRequest object can be populated with NamenID, NameIDFormat and SessionIndex.

var saml2LogoutRequest = new Saml2LogoutRequest(config);
saml2LogoutRequest.NameId = new Saml2NameIdentifier("..NameID..", new Uri("..NameIDFormat.."));            
saml2LogoutRequest.SessionIndex = "..SessionIndex..";
Related