There is no pending service provider authentication request.

I’m trying to create an Example Identity Provider that calls the WebForms/ExampleServiceProvider application provided by Component Space.

Here’s my saml.config. It’s copied from the WebForms/ExampleIdentityProvider web config
:<?xml version="1.0"?>
[
<IdentityProvider Name=“<a href=“https://ExampleIdentityProvider””>https://ExampleIdentityProvider"
Description=“Example Identity Provider”
LocalCertificateFile=“Certificates\idp.pfx”
LocalCertificatePassword=“password”/>


<PartnerServiceProvider Name=“<a href=“https://ExampleServiceProvider””>https://ExampleServiceProvider"
Description=“Example Service Provider”
WantAuthnRequestSigned=“true”
SignSAMLResponse=“true”
SignAssertion=“false”
EncryptAssertion=“false”
LocalCertificateStoreLocation=“CurrentUser”
AssertionConsumerServiceUrl=“<a href=“https://localhost:44338/SAML/AssertionConsumerService.aspx””>https://localhost:44338/SAML/AssertionConsumerService.aspx"
SingleLogoutServiceUrl=“<a href=“https://localhost:44338/SAML/SLOService.aspx””>https://localhost:44338/SAML/SLOService.aspx"
PartnerCertificateFile=“Certificates\sp.cer”/>



I call InitiateSSO and SendSSO from my home controller. I mocked the attributes from the example from Component Space:
public ActionResult Index()
{
ViewBag.Title = “Home Page”;
var userName = “testuser”;

IDictionary<string, string> attributes = new Dictionary<string, string>();
attributes.Add(“Email”, “testuser@idp.com”);
attributes.Add(“GivenName”, “Test”);
attributes.Add(“FamilyName”, “User”);

ComponentSpace.SAML2.Data.SessionIDDelegates.SecureSAMLCookie = false;
var partnerName = “<a href=“https://ExampleServiceProvider”;”>https://ExampleServiceProvider";
string relayState = null;
SAMLIdentityProvider.InitiateSSO(Response, userName, attributes, relayState, partnerName);
SAMLIdentityProvider.SendSSO(Response, userName, attributes);
return View();
The code throws the “There is no pending service provider authentication request.” exception when it tries to call
SAMLIdentityProvider.SendSSO(Response, userName, attributes);

Below is the SAML trace. I’m completely stumped:


24584/10: 11/12/2019 11:06:48 AM: ComponentSpace.SAML2, Version=3.4.0.0, Culture=neutral, PublicKeyToken=16647a1283418145, .NET v4.6.2 build, Licensed.
24584/10: 11/12/2019 11:06:48 AM: CLR: 4.0.30319.42000, OS: Microsoft Windows NT 10.0.14393.0, Account: GHC-HMO\jniesen, Culture: English (United States)
24584/10: 11/12/2019 11:06:48 AM: Initializing the SAML environment.
24584/10: 11/12/2019 11:06:48 AM: Loading the SAML configuration file E:\repos\SAMLApps\ExampleIdentityProvider\ExampleIdentityProvider\saml.config.
24584/10: 11/12/2019 11:06:48 AM: SAML configuration:
<?xml version="1.0"?>

<IdentityProvider Name=“<a href=“https://ExampleIdentityProvider””>https://ExampleIdentityProvider"
Description=“Example Identity Provider”
LocalCertificateFile=“Certificates\idp.pfx”
LocalCertificatePassword=“********”/>



<PartnerServiceProvider Name=“<a href=“https://ExampleServiceProvider””>https://ExampleServiceProvider"
Description=“Example Service Provider”
WantAuthnRequestSigned=“true”
SignSAMLResponse=“true”
SignAssertion=“false”
EncryptAssertion=“false”
LocalCertificateStoreLocation=“CurrentUser”
AssertionConsumerServiceUrl=“<a href=“https://localhost:44338/SAML/AssertionConsumerService.aspx””>https://localhost:44338/SAML/AssertionConsumerService.aspx"
SingleLogoutServiceUrl=“<a href=“https://localhost:44338/SAML/SLOService.aspx””>https://localhost:44338/SAML/SLOService.aspx"
PartnerCertificateFile=“Certificates\sp.cer”/>



24584/10: 11/12/2019 11:06:48 AM: The SAML configuration file has been successfully loaded.
24584/10: 11/12/2019 11:06:48 AM: SAML configuration changes in the directory E:\repos\SAMLApps\ExampleIdentityProvider\ExampleIdentityProvider are being monitored.
24584/10: 11/12/2019 11:06:48 AM: The SAML environment has been successfuly initialized.
24584/10: 11/12/2019 11:06:48 AM: The SAML_SessionId cookie with value 24bf7578-0c33-43b6-b339-0b6d9f8ac62c has been set.
24584/10: 11/12/2019 11:06:48 AM: Initiating SSO to the partner service provider https://ExampleServiceProvider.
24584/10: 11/12/2019 11:06:48 AM: Identity provider session (24bf7578-0c33-43b6-b339-0b6d9f8ac62c) state:
24584/10: 11/12/2019 11:06:48 AM: Retrieving the local identity provider signature certificates for the partner service provider https://ExampleServiceProvider.
24584/10: 11/12/2019 11:06:48 AM: Loading the X.509 certificate from the file E:\repos\SAMLApps\ExampleIdentityProvider\ExampleIdentityProvider\Certificates\idp.pfx.
24584/10: 11/12/2019 11:06:48 AM: The X.509 certificate with subject name CN=www.idp.com and serial number 74F0EBFE22358DB8433138F9558C9AF9 has been loaded.
24584/10: 11/12/2019 11:06:49 AM: The X.509 certificate with subject name CN=www.idp.com and serial number 74F0EBFE22358DB8433138F9558C9AF9 has been cached.
24584/10: 11/12/2019 11:06:49 AM: Generating an XML signature.
24584/10: 11/12/2019 11:06:49 AM: XML signature generation was successful.
24584/10: 11/12/2019 11:06:49 AM: Sending response over HTTP POST, targetURL=https://localhost:44338/SAML/AssertionConsumerService.aspx, samlMessage=<samlp
:Response ID=“_2b3bdd0e-6bce-48e1-a2cd-7946118c7d46” Version=“2.0” IssueInstant=“2019-11-12T17:06:48.893Z”
Destination=“<a href=“https://localhost:44338/SAML/AssertionConsumerService.aspx””>https://localhost:44338/SAML/AssertionConsumerService.aspx" xmlns:samlp=“urn:oasis:names:tc:SAML:2.0:protocol”><saml:Issuer xmlns:saml=“urn:oasis:names:tc:SAML:2.0:assertion”>
https://ExampleIdentityProvider</saml:Issuer><Signature xmlns=“<CanonicalizationMethod”>http://www.w3.org/2000/09/xmldsig#“><CanonicalizationMethod Algorithm=”<a href=“http://www.w3.org/2001/10/xml-exc-c14n#”“>http://www.w3.org/2001/10/xml-exc-c14n#” />
<SignatureMethod Algorithm=“<a href=“http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"”>http://www.w3.org/2001/04/xmldsig-more#rsa-sha256” />
<Transform Algorithm=“<a href=“http://www.w3.org/2000/09/xmldsig#enveloped-signature””>http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm=“”>http://www.w3.org/2001/10/xml-exc-c14n#“>
<InclusiveNamespaces PrefixList=”#default samlp saml ds xs xsi" xmlns=“<a href=“http://www.w3.org/2001/10/xml-exc-c14n#””>http://www.w3.org/2001/10/xml-exc-c14n#“ /><DigestMethod
Algorithm=”<a href=“http://www.w3.org/2001/04/xmlenc#sha256"”>http://www.w3.org/2001/04/xmlenc#sha256" />l0BObMAzdrxHbnj6OmQQQ3ztomYf9BqkFH6cwh6vY2Y=
Is7orRMyjDLwVo4rOGU5jc0229BvaEfVzPBMqZzFBhKHCVUfPFDTCFexkzLfuFD754eeF2vQPtQjLfGC+VCqP8i3xusmfEy3QOVtFLgnf0c3yHLzWXoInYQ8luyS3843l93k0bs/SnDFuZkePE/H18A
HebLithiFDy6OqZRFFI3mro4uWf0jbHwobrOsRyyLZuFwyLqleBXt/1+ckbbkeh54Er0rHfreTagpJM/Zl7JmhlbAX3JugE7ZUXt2ny4LQ0QT5BrtbXBRS348uPNJQXagUypd29q5ZJBKeap+B7IWb9pSb62J+qRSJ0d9RzA
o6RWavcsSWFnKs4/I5lu6Gg==MIIDATCCAemgAwIBAgIQdPDr/iI1jbhDMTj5VYya+TANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDEwt3d3cuaWRwL
mNvbTAeFw0xMzExMjIwODIwNTJaFw00OTEyMzExNDAwMDBaMBYxFDASBgNVBAMTC3d3dy5pZHAuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAi0XJRLDrcbSyqUd8XG4BgxObQMYLAk
ENlmJOsAEpl1xMabUiq1X4v0Fc8ZaCpUE3fFGENMEWgBjnQUUE0WtVUh5JPMsukolf9qljbJkCkvHXH3O4Uen7vA2oNQWt4bK96SpXADpZKFvpk4D7btKOgU/NamjiqwHI4fI8kFJKwKBJchRPUQdC4ljRRmGIrSnp
Y+t25/d3KGXwbe9Z2MGGy2hyA0tgOWuchIK+1vAKKBUh9nDEXfr80+xW680w5TqHyDcqbWvQsXXhH0yZLfINKNS6/IojHPsBy7tf36Ck9H5Pw+1PPu6NzBFSz5ZkC8KzrS6vuZXc/ImYrnheMQsqqQIDAQABo0sw
STBHBgNVHQEEQDA+gBD4dY4MCPEmG4sxZrcni8vtoRgwFjEUMBIGA1UEAxMLd3d3LmlkcC5jb22CEHTw6/4iNY24QzE4+VWMmvkwDQYJKoZIhvcNAQELBQADggEBABhak2aR84MCdyXO4AKOQvZybsCMdh
Rq2i1i0WhD4/xe7Ry5haC6TeXIp8Q4cC3MzsrDal74xHI714BW0loafpHAsXfd9EvkKTVaJ+1Zpe16+SsTL4upS1cGydigqwUzsdpGck4wI1moJ9477O+46If2gF27u9Cdk7Onxe/5dwLIxWmkVRdbQIH5GsKUeAjOdRQmy+
X1MX6KyRoaCwWGYwxi5Sa+r+3AtDvD4BX0EJGKFZeeM3J/yMpYh/75aN0cFQfDEdJ7C5NE0vonidE0QtIFvsoWtZUtur2fiW7yBxse38TPQsi2r6A6c/TZsZ5bq31yh3gr3kSN62H8iVKLQLA=
samlp:Status<samlp:StatusCode Value=“urn:oasis:names:tc:SAML:2.0:status:Success” /></samlp:Status><saml:Assertion Version=“2.0”
ID=“_dc72263c-319e-4801-ac7e-392dece5aef0” IssueInstant=“2019-11-12T17:06:48.897Z” xmlns:saml=“urn:oasis:names:tc:SAML:2.0:assertion”>saml:Issuerhttps://ExampleIdentityProvider</saml:Issuer>
saml:Subject<saml:NameID Format=“urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified”>testuser</saml:NameID><saml:SubjectConfirmation Method=“urn:oasis:names:tc:SAML:2.0:cm:bearer”>
<saml:SubjectConfirmationData NotOnOrAfter=“2019-11-12T17:09:48.899Z” Recipient=“<a href=“https://localhost:44338/SAML/AssertionConsumerService.aspx””>https://localhost:44338/SAML/AssertionConsumerService.aspx" /></saml:SubjectConfirmation></saml:Subject>
<saml:Conditions NotBefore=“2019-11-12T17:03:48.897Z” NotOnOrAfter=“2019-11-12T17:09:48.897Z”>saml:AudienceRestrictionsaml:Audiencehttps://ExampleServiceProvider</saml:Audience>
</saml:AudienceRestriction></saml:Conditions><saml:AuthnStatement AuthnInstant=“2019-11-12T17:06:48.9Z” SessionIndex=“_dc72263c-319e-4801-ac7e-392dece5aef0”>saml:AuthnContext
saml:AuthnContextClassRefurn:oasis:names:tc:SAML:2.0:ac:classes:unspecified</saml:AuthnContextClassRef></saml:AuthnContext></saml:AuthnStatement>saml:AttributeStatement<saml:Attribute
Name=“Email”><saml:AttributeValue xsi:type=“xs:string” xmlns:xs=“<a href=“http://www.w3.org/2001/XMLSchema””>http://www.w3.org/2001/XMLSchema" xmlns:xsi=“”>http://www.w3.org/2001/XMLSchema-instance">testuser@idp.com</saml:AttributeValue>
</saml:Attribute><saml:Attribute Name=“GivenName”><saml:AttributeValue xsi:type=“xs:string” xmlns:xs=“<a href=“http://www.w3.org/2001/XMLSchema””>http://www.w3.org/2001/XMLSchema" xmlns:xsi=“Test</saml:AttributeValue>”>http://www.w3.org/2001/XMLSchema-instance">Test</saml:AttributeValue>
</saml:Attribute><saml:Attribute Name=“FamilyName”><saml:AttributeValue xsi:type=“xs:string” xmlns:xs=“<a href=“http://www.w3.org/2001/XMLSchema””>http://www.w3.org/2001/XMLSchema" xmlns:xsi=“User</saml:AttributeValue>”>http://www.w3.org/2001/XMLSchema-instance">User</saml:AttributeValue>
</saml:Attribute></saml:AttributeStatement></saml:Assertion></samlp:Response>, relayState=
24584/10: 11/12/2019 11:06:49 AM: Sending form by HTTP Post:




Since your browser doesn’t support JavaScript, you must press the Continue button to proceed.



<form id=“samlform” action=“<a href=“https://localhost:44338/SAML/AssertionConsumerService.aspx””>https://localhost:44338/SAML/AssertionConsumerService.aspx" method=“post” target=“_self”>













24584/10: 11/12/2019 11:06:49 AM: Sending SAML form:




Since your browser doesn’t support JavaScript, you must press the Continue button to proceed.



<form id=“samlform” action=“<a href=“https://localhost:44338/SAML/AssertionConsumerService.aspx””>https://localhost:44338/SAML/AssertionConsumerService.aspx" method=“post” target=“_self”>













24584/10: 11/12/2019 11:06:49 AM: Response sent over HTTP POST.
24584/10: 11/12/2019 11:06:49 AM: SAML message sent: partner=https://ExampleServiceProvider, message=<samlp:Response ID=“_2b3bdd0e-6bce-48e1-a2cd-7946118c7d46” Version=“2.0” IssueInstant=“2019-11-12T17:06:48.893Z” Destination=“<a href=“https://localhost:44338/SAML/AssertionConsumerService.aspx””>https://localhost:44338/SAML/AssertionConsumerService.aspx" xmlns:samlp=“urn:oasis:names:tc:SAML:2.0:protocol”><saml:Issuer xmlns:saml=“urn:oasis:names:tc:SAML:2.0:assertion”>https://ExampleIdentityProvider</saml:Issuer><Signature xmlns=“<CanonicalizationMethod”>http://www.w3.org/2000/09/xmldsig#“><CanonicalizationMethod Algorithm=”<a href=“http://www.w3.org/2001/10/xml-exc-c14n#”“>http://www.w3.org/2001/10/xml-exc-c14n#” /><SignatureMethod Algorithm=“<a href=“http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"”>http://www.w3.org/2001/04/xmldsig-more#rsa-sha256” /><Transform Algorithm=“<a href=“http://www.w3.org/2000/09/xmldsig#enveloped-signature””>http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm=“<InclusiveNamespaces”>http://www.w3.org/2001/10/xml-exc-c14n#“><InclusiveNamespaces PrefixList=”#default samlp saml ds xs xsi" xmlns=“<a href=“http://www.w3.org/2001/10/xml-exc-c14n#””>http://www.w3.org/2001/10/xml-exc-c14n#“ /><DigestMethod Algorithm=”<a href=“http://www.w3.org/2001/04/xmlenc#sha256"”>http://www.w3.org/2001/04/xmlenc#sha256" />l0BObMAzdrxHbnj6OmQQQ3ztomYf9BqkFH6cwh6vY2Y=Is7orRMyjDLwVo4rOGU5jc0229BvaEfVzPBMqZzFBhKHCVUfPFDTCFexkzLfuFD754eeF2vQPtQjLfGC+VCqP8i3xusmfEy3QOVtFLgnf0c3yHLzWXoInYQ8luyS3843l93k0bs/SnDFuZkePE/H18AHebLithiFDy6OqZRFFI3mro4uWf0jbHwobrOsRyyLZuFwyLqleBXt/1+ckbbkeh54Er0rHfreTagpJM/Zl7JmhlbAX3JugE7ZUXt2ny4LQ0QT5BrtbXBRS348uPNJQXagUypd29q5ZJBKeap+B7IWb9pSb62J+qRSJ0d9RzAo6RWavcsSWFnKs4/I5lu6Gg==MIIDATCCAemgAwIBAgIQdPDr/iI1jbhDMTj5VYya+TANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDEwt3d3cuaWRwLmNvbTAeFw0xMzExMjIwODIwNTJaFw00OTEyMzExNDAwMDBaMBYxFDASBgNVBAMTC3d3dy5pZHAuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAi0XJRLDrcbSyqUd8XG4BgxObQMYLAkENlmJOsAEpl1xMabUiq1X4v0Fc8ZaCpUE3fFGENMEWgBjnQUUE0WtVUh5JPMsukolf9qljbJkCkvHXH3O4Uen7vA2oNQWt4bK96SpXADpZKFvpk4D7btKOgU/NamjiqwHI4fI8kFJKwKBJchRPUQdC4ljRRmGIrSnpY+t25/d3KGXwbe9Z2MGGy2hyA0tgOWuchIK+1vAKKBUh9nDEXfr80+xW680w5TqHyDcqbWvQsXXhH0yZLfINKNS6/IojHPsBy7tf36Ck9H5Pw+1PPu6NzBFSz5ZkC8KzrS6vuZXc/ImYrnheMQsqqQIDAQABo0swSTBHBgNVHQEEQDA+gBD4dY4MCPEmG4sxZrcni8vtoRgwFjEUMBIGA1UEAxMLd3d3LmlkcC5jb22CEHTw6/4iNY24QzE4+VWMmvkwDQYJKoZIhvcNAQELBQADggEBABhak2aR84MCdyXO4AKOQvZybsCMdhRq2i1i0WhD4/xe7Ry5haC6TeXIp8Q4cC3MzsrDal74xHI714BW0loafpHAsXfd9EvkKTVaJ+1Zpe16+SsTL4upS1cGydigqwUzsdpGck4wI1moJ9477O+46If2gF27u9Cdk7Onxe/5dwLIxWmkVRdbQIH5GsKUeAjOdRQmy+X1MX6KyRoaCwWGYwxi5Sa+r+3AtDvD4BX0EJGKFZeeM3J/yMpYh/75aN0cFQfDEdJ7C5NE0vonidE0QtIFvsoWtZUtur2fiW7yBxse38TPQsi2r6A6c/TZsZ5bq31yh3gr3kSN62H8iVKLQLA=samlp:Status<samlp:StatusCode Value=“urn:oasis:names:tc:SAML:2.0:status:Success” /></samlp:Status><saml:Assertion Version=“2.0” ID=“_dc72263c-319e-4801-ac7e-392dece5aef0” IssueInstant=“2019-11-12T17:06:48.897Z” xmlns:saml=“urn:oasis:names:tc:SAML:2.0:assertion”>saml:Issuerhttps://ExampleIdentityProvider</saml:Issuer>saml:Subject<saml:NameID Format=“urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified”>testuser</saml:NameID><saml:SubjectConfirmation Method=“urn:oasis:names:tc:SAML:2.0:cm:bearer”><saml:SubjectConfirmationData NotOnOrAfter=“2019-11-12T17:09:48.899Z” Recipient=“<a href=“https://localhost:44338/SAML/AssertionConsumerService.aspx””>https://localhost:44338/SAML/AssertionConsumerService.aspx" /></saml:SubjectConfirmation></saml:Subject><saml:Conditions NotBefore=“2019-11-12T17:03:48.897Z” NotOnOrAfter=“2019-11-12T17:09:48.897Z”>saml:AudienceRestrictionsaml:Audiencehttps://ExampleServiceProvider</saml:Audience></saml:AudienceRestriction></saml:Conditions><saml:AuthnStatement AuthnInstant=“2019-11-12T17:06:48.9Z” SessionIndex=“_dc72263c-319e-4801-ac7e-392dece5aef0”>saml:AuthnContextsaml:AuthnContextClassRefurn:oasis:names:tc:SAML:2.0:ac:classes:unspecified</saml:AuthnContextClassRef></saml:AuthnContext></saml:AuthnStatement>saml:AttributeStatement<saml:Attribute Name=“Email”><saml:AttributeValue xsi:type=“xs:string” xmlns:xs=“<a href=“http://www.w3.org/2001/XMLSchema””>http://www.w3.org/2001/XMLSchema" xmlns:xsi=“”>http://www.w3.org/2001/XMLSchema-instance">testuser@idp.com</saml:AttributeValue></saml:Attribute><saml:Attribute Name=“GivenName”><saml:AttributeValue xsi:type=“xs:string” xmlns:xs=“<a href=“http://www.w3.org/2001/XMLSchema””>http://www.w3.org/2001/XMLSchema" xmlns:xsi=“Test</saml:AttributeValue></saml:Attribute>saml:Attribute"http://www.w3.org/2001/XMLSchema-instance”>Test</saml:AttributeValue></saml:Attribute><saml:Attribute Name=“FamilyName”><saml:AttributeValue xsi:type=“xs:string” xmlns:xs=“<a href=“http://www.w3.org/2001/XMLSchema””>http://www.w3.org/2001/XMLSchema" xmlns:xsi=“User</saml:AttributeValue></saml:Attribute></saml:AttributeStatement></saml:Assertion></samlp:Response>,”>http://www.w3.org/2001/XMLSchema-instance">User</saml:AttributeValue></saml:Attribute></saml:AttributeStatement></saml:Assertion></samlp:Response>, relay state=, destination URL=https://localhost:44338/SAML/AssertionConsumerService.aspx
24584/10: 11/12/2019 11:06:49 AM: Identity provider session (24bf7578-0c33-43b6-b339-0b6d9f8ac62c) state:
SSO session state:
Partner name: https://ExampleServiceProvider
Name ID: <saml:NameID Format=“urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified” xmlns:saml=“urn:oasis:names:tc:SAML:2.0:assertion”>testuser</saml:NameID>
Session index: _dc72263c-319e-4801-ac7e-392dece5aef0

24584/10: 11/12/2019 11:06:49 AM: Initiation of SSO to the partner service provider https://ExampleServiceProvider has completed successfully.
24584/10: 11/12/2019 11:06:52 AM: Sending an SSO response to a partner service provider.
24584/10: 11/12/2019 11:06:52 AM: Identity provider session (24bf7578-0c33-43b6-b339-0b6d9f8ac62c) state:
SSO session state:
Partner name: https://ExampleServiceProvider
Name ID: <saml:NameID Format=“urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified” xmlns:saml=“urn:oasis:names:tc:SAML:2.0:assertion”>testuser</saml:NameID>
Session index: _dc72263c-319e-4801-ac7e-392dece5aef0

24584/10: 11/12/2019 11:06:52 AM: Exception: ComponentSpace.SAML2.Exceptions.SAMLProtocolException: There is no pending service provider authentication request.
24584/10: 11/12/2019 11:06:52 AM: at ComponentSpace.SAML2.InternalSAMLIdentityProvider.SendSSO(HttpResponseBase httpResponse, String userName, SAMLAttribute[] attributes, String authnContext, Status status, String assertionConsumerServiceUrl)
at ComponentSpace.SAML2.SAMLIdentityProvider.SendSSO(HttpResponseBase httpResponse, String userName, IDictionary attributes)
at ExampleIdentityProvider.Controllers.HomeController.Index() in E:\repos\SAMLApps\ExampleIdentityProvider\ExampleIdentityProvider\Controllers\HomeController.cs:line 26
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c.b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_0.b__0()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.b__2()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass7_0.b__1(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_6.b__4()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.b__1(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.<>c.b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase.End()
at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.<>c.b__151_2(IAsyncResult asyncResult, Controller controller)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase.End()
at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.<>c.b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase.End()
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)





SAMLIdentityProvider.InitiateSSO creates and sends a SAML response to a partner SP as part of IdP-initiated SSO.

The IdP-initiated SSO flow is:
1. Authenticate the user.
2. Call SAMLIdentityProvider.InitiateSSO to create and send a SAML response to the SP.
3. Control is now at the SP to process the SAML response.

SAMLIdentityProvider.SendSSO creates and sends a SAML response to a partner SP as part of SP-initiated SSO.
It only makes sense to call SAMLIdentityProvider.SendSSO if SAMLIdentityProvider.ReceiveSSO has been previously called to receive and process an authn request.
Also, you shouldn’t call SAMLIdentityProvider.SendSSO immediately after SAMLIdentityProvider.InitiateSSO.
This will effectively discard the call to SAMLIdentityProvider.InitiateSSO as only one SAML response can be sent to the SP at any one time via the HTTP response.

The SP-initiated SSO flow is:

1. Call SAMLIdentityProvider.ReceiveSSO to receive and process a SAML authn request sent by the SP.
2. Authenticate the user.
3. Call SAMLIdentityProvider.SendSSO to create and send a SAML response to the SP.
4. Control is now at the SP to process the SAML response.

The ExampleIdentityProvider project under the Examples\SSO\WebForms folder demonstrates calling these APIs.
The Examples Guide walks you through the ExampleIdentityProvider and other projects.

[quote]
ComponentSpace - 11/12/2019
SAMLIdentityProvider.InitiateSSO creates and sends a SAML response to a partner SP as part of IdP-initiated SSO.

The IdP-initiated SSO flow is:
1. Authenticate the user.
2. Call SAMLIdentityProvider.InitiateSSO to create and send a SAML response to the SP.
3. Control is now at the SP to process the SAML response.

SAMLIdentityProvider.SendSSO creates and sends a SAML response to a partner SP as part of SP-initiated SSO.
It only makes sense to call SAMLIdentityProvider.SendSSO if SAMLIdentityProvider.ReceiveSSO has been previously called to receive and process an authn request.
Also, you shouldn't call SAMLIdentityProvider.SendSSO immediately after SAMLIdentityProvider.InitiateSSO.
This will effectively discard the call to SAMLIdentityProvider.InitiateSSO as only one SAML response can be sent to the SP at any one time via the HTTP response.

The SP-initiated SSO flow is:

1. Call SAMLIdentityProvider.ReceiveSSO to receive and process a SAML authn request sent by the SP.
2. Authenticate the user.
3. Call SAMLIdentityProvider.SendSSO to create and send a SAML response to the SP.
4. Control is now at the SP to process the SAML response.

The ExampleIdentityProvider project under the Examples\SSO\WebForms folder demonstrates calling these APIs.
The Examples Guide walks you through the ExampleIdentityProvider and other projects.
[/quote]

Thanks, I got it working after reading your post

You’re welcome.