我正在使用Kentor Auth Services并尝试将其与Thinktecture Identity Server配合使用。我在阅读元数据时遇到此错误:
序列不包含元素
以下是我在Startup.cs文件中使用的代码:
var authServicesOptions = new Kentor.AuthServices.Owin.KentorAuthServicesAuthenticationOptions(false)
{
SPOptions = new SPOptions
{
EntityId = new EntityId("https://dev.identity.research.ufl.edu:4432/AuthServices")
},
SignInAsAuthenticationType = signInAsType,
AuthenticationType = "saml2p",
Caption = "SAML2p",
};
authServicesOptions.IdentityProviders.Add(new IdentityProvider(
new EntityId("urn:edu:ufl:dev:00856"),
authServicesOptions.SPOptions)
{
MetadataLocation = "https://dev.identity.research.ufl.edu:4432/EMvc/Metadata.txt",
});
app.UseKentorAuthServicesAuthentication(authServicesOptions);
此外,我还包括错误消息和下面的堆栈跟踪的一部分。
非常感谢您提供的有关如何解决此错误的任何帮助。
此致 谢丽尔·比尔登
[InvalidOperationException:Sequence不包含任何元素]
System.Linq.Enumerable.Single(IEnumerable 1 source) +310
Kentor.AuthServices.IdentityProvider.ReadMetadataIdpDescriptor(ExtendedEntityDescriptor metadata) +108
Kentor.AuthServices.IdentityProvider.ReadMetadata(ExtendedEntityDescriptor metadata) +132
Kentor.AuthServices.IdentityProvider.DoLoadMetadata() +127
Kentor.AuthServices.IdentityProvider.ReloadMetadataIfRequired() +169
Kentor.AuthServices.IdentityProvider.CreateAuthenticateRequest(AuthServicesUrls authServicesUrls) +73
Kentor.AuthServices.WebSso.SignInCommand.InitiateLoginToIdp(IOptions options, IDictionary
2 relayData,AuthServicesUrls urls,IdentityProvider idp,Uri returnUrl)+36
Kentor.AuthServices.WebSso.SignInCommand.Run(EntityId idpEntityId,String returnPath,HttpRequestData request,IOptions options,IDictionary`2 relayData)+447
Kentor.AuthServices.Owin.d__1.MoveNext()+781