我正在为现有的.net应用程序启用SSO。我使用组件空间SAML 2.0组件作为服务提供者(SP)和ADFS 2.0作为身份提供者(IdP)我已经在不同的服务上配置了ADFS而SP在不同的服务器上。我正在启动SP InitiateSSO被调用并且浏览器被重定向到IdP url并基于中继方url将其返回给SP。
试图获得:
SAMLServiceProvider.ReceiveSSO(Request, out isInResponseTo, out partnerIdP, out userName, out attributes, out targetUrl);
其说法“未配置合作伙伴身份提供商http://sp.com/adfs/services/trust”。
在小提琴手中我接到了电话。
堆栈跟踪
[SAMLException: The partner identity provider http:// sp.com/adfs/services/trust is not configured.]
ComponentSpace.SAML2.Configuration.SAMLConfiguration.GetPartnerIdentityProvider(String name) in c:\Sandboxes\ComponentSpace\SAMLv20\Library\Configuration\SAMLConfiguration.cs:245
ComponentSpace.SAML2.SAMLServiceProvider.ReceiveSSO(HttpRequest httpRequest, Boolean& isInResponseTo, String& partnerIdP, String& userName, SAMLAttribute[]& attributes, String& relayState) in c:\Sandboxes\ComponentSpace\SAMLv20\Library\SAMLServiceProvider.cs:664
ComponentSpace.SAML2.SAMLServiceProvider.ReceiveSSO(HttpRequest httpRequest, Boolean& isInResponseTo, String& partnerIdP, String& userName, IDictionary`2& attributes, String& relayState) in c:\Sandboxes\ComponentSpace\SAMLv20\Library\SAMLServiceProvider.cs:637
ExampleServiceProvider.SAML.AssertionConsumerService.Page_Load(Object sender, EventArgs e) in C:\Program Files (x86)\ComponentSpace SAML v2.0 for .NET\Examples\SSO\HighLevelAPI\WebForms\ExampleServiceProvider\SAML\AssertionConsumerService.aspx.cs:28
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
System.Web.UI.Control.OnLoad(EventArgs e) +132
System.Web.UI.Control.LoadRecursive() +66
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428
ADFS配置是:
<PartnerIdentityProvider Name="https://sp.com/adfs/services/trust"
SignAuthnRequest="true"
WantSAMLResponseSigned="false"
WantAssertionSigned="false"
WantAssertionEncrypted="false"
UseEmbeddedCertificate="true"
SingleSignOnServiceUrl="http://sp.com/adfs/ls/"/ >
服务提供商配置如下:
<SAMLConfiguration xmlns="urn:componentspace:SAML:2.0:configuration">
<ServiceProvider Name="https://demo.sp.com"
AssertionConsumerServiceUrl="~/SAML/AssertionConsumerService.aspx"
CertificateFile="sp.pfx"
CertificatePassword="password" />
我进入的错误:
Server Error in '/' Application.
The partner identity provider http:// sp.com/adfs/services/trust is not configured. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: ComponentSpace.SAML2.Exceptions.SAMLException: The partner identity provider http:// sp.com/adfs/services/trust is not configured.
答案 0 :(得分:0)
我通过更改身份验证的顺序解决了这个问题。
现在它的工作。 : - )
答案 1 :(得分:0)
ComponentSpace实际引发了以下错误:
合作伙伴身份提供商http://sp.com/adfs/services/trust是 未配置
这是因为PartnerSP
中的<appSettings />
键与Name
中的<PartnerIdentityProvider />
属性不匹配:
<强> saml.config 强>:
<PartnerIdentityProvider Name="https://sp.com/adfs/services/trust" ... />
<强>的Web.config 强>:
<appSettings>
<add key="PartnerSP" value="http://sp.com/adfs/services/trust />
...
</appSettings>
PartnerIdentityProvider的名称应设置为:http://sp.com/adfs/services/trust