本文整理汇总了C#中IdentityProvider.ReadMetadata方法的典型用法代码示例。如果您正苦于以下问题:C# IdentityProvider.ReadMetadata方法的具体用法?C# IdentityProvider.ReadMetadata怎么用?C# IdentityProvider.ReadMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IdentityProvider
的用法示例。
在下文中一共展示了IdentityProvider.ReadMetadata方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IdentityProvider_ReadMetadata_Nullcheck
public void IdentityProvider_ReadMetadata_Nullcheck()
{
var subject = new IdentityProvider(
new EntityId("http://idp.example.com"),
StubFactory.CreateSPOptions());
Action a = () => subject.ReadMetadata(null);
a.ShouldThrow<ArgumentNullException>().And.ParamName.Should().Be("metadata");
}
示例2: IdentityProvider_ConstructedFromEntityDescriptor_DoesntScheduleMedataRefresh
public void IdentityProvider_ConstructedFromEntityDescriptor_DoesntScheduleMedataRefresh()
{
MetadataRefreshScheduler.minInterval = new TimeSpan(0, 0, 0, 0, 1);
var ed = new ExtendedEntityDescriptor
{
ValidUntil = DateTime.UtcNow.AddYears(-1),
EntityId = new EntityId("http://localhost:13428/idpMetadata")
};
var idpSsoDescriptor = new IdentityProviderSingleSignOnDescriptor();
idpSsoDescriptor.ProtocolsSupported.Add(new Uri("urn:oasis:names:tc:SAML:2.0:protocol"));
ed.RoleDescriptors.Add(idpSsoDescriptor);
var pe = new ProtocolEndpoint()
{
Binding = Saml2Binding.HttpRedirectUri,
Location = new Uri("http://idp.example.com/sso")
};
idpSsoDescriptor.SingleSignOnServices.Add(pe);
idpSsoDescriptor.Keys.Add(SignedXmlHelper.TestKeyDescriptor);
var subject = new IdentityProvider(ed.EntityId, StubFactory.CreateSPOptions());
subject.ReadMetadata(ed);
// Ugly, but have to wait and see that nothing happened. Have tried
// some different timeouts but need 100 to ensure fail before bug
// is fixed :-(
Thread.Sleep(100);
// Would be changed if metadata was reloaded.
subject.SingleSignOnServiceUrl.Should().Be(pe.Location);
}