public void IdentityProviderCollection_RegisterIdentityProvider_NullCheck() { var subject = new IdentityProviderCollection(); Action a = () => subject.RegisterIdentityProviders(null); a.ShouldThrow <ArgumentNullException>().And.ParamName.Should().Be("options"); }
public void IdentityProviderCollection_RegisterIdentityProvider_NullCheck() { var subject = new IdentityProviderCollection(); Action a = () => subject.RegisterIdentityProviders(null); a.ShouldThrow<ArgumentNullException>().And.ParamName.Should().Be("options"); }
private IdentityProviders ToIdentityProviders(IEnumerable<IdentityProvider> providers, IdentityProviderCollection config) { var idps = new IdentityProviders(providers) { Encodings = config.Encodings, SelectionUrl = config.SelectionUrl }; idps.AddByMetadataDirectory(config.MetadataLocation); return idps; }
public void CanLoadMetadataFileWithMultipleIdpDescriptors() { var collection = new IdentityProviderCollection { MetadataLocation = Path.Combine(TestContext.CurrentContext.TestDirectory, "Protocol", "MetadataDocs", "multiple-idps") }; collection.Refresh(); Assert.That(collection.Count == 2); }
/// <summary> /// Validates the <see cref="IdentityProviderCollection"/>. /// </summary> /// <param name="identityProviders">The <see cref="IdentityProviderCollection"/>.</param> private void ValidateIdentityProviders(IdentityProviderCollection identityProviders) { if (identityProviders == null) { throw new Saml20ConfigurationException("Configuration IdentityProviders cannot be null"); } foreach (var idp in identityProviders) { _identityProviderValidator.ValidateIdentityProvider(idp); } }
private IdentityProviders ToIdentityProviders(IEnumerable <IdentityProvider> providers, IdentityProviderCollection config) { var idps = new IdentityProviders(providers) { Encodings = config.Encodings, SelectionUrl = config.SelectionUrl }; idps.AddByMetadataDirectory(config.MetadataLocation); return(idps); }
/// <summary> /// Invokes the IDP selection event handler. /// </summary> /// <param name="endpoints">The endpoints.</param> /// <returns>The <see cref="IdentityProviderElement"/>.</returns> internal static IdentityProviderElement InvokeIDPSelectionEventHandler(IdentityProviderCollection endpoints) { return IdpSelectionEvent != null ? IdpSelectionEvent(endpoints) : null; }
/// <summary> /// Invokes the IDP selection event handler. /// </summary> /// <param name="endpoints">The endpoints.</param> /// <returns>The <see cref="IdentityProviderElement"/>.</returns> internal static IdentityProviderElement InvokeIDPSelectionEventHandler(IdentityProviderCollection endpoints) { return(IdpSelectionEvent != null?IdpSelectionEvent(endpoints) : null); }
private IdentityProviders ToIdentityProviders(IEnumerable <IdentityProvider> providers, IdentityProviderCollection config) { return(new IdentityProviders(providers) { Encodings = config.Encodings, MetadataLocation = config.MetadataLocation, SelectionUrl = config.SelectionUrl }); }