/// <summary> /// Initializes a new instance of the <see cref="ExtensionsBindingElement"/> class. /// </summary> /// <param name="extensionFactory">The extension factory.</param> /// <param name="securitySettings">The security settings.</param> /// <param name="receiveUnsignedExtensions">Security setting for relying parties. Should be true for Providers.</param> internal ExtensionsBindingElement(IOpenIdExtensionFactory extensionFactory, SecuritySettings securitySettings, bool receiveUnsignedExtensions) { Requires.NotNull(extensionFactory, "extensionFactory"); Requires.NotNull(securitySettings, "securitySettings"); this.ExtensionFactory = extensionFactory; this.receiveUnsignedExtensions = receiveUnsignedExtensions; }
/// <summary> /// Initializes a new instance of the <see cref="ExtensionsBindingElementRelyingParty"/> class. /// </summary> /// <param name="extensionFactory">The extension factory.</param> /// <param name="securitySettings">The security settings.</param> internal ExtensionsBindingElementRelyingParty(IOpenIdExtensionFactory extensionFactory, RelyingPartySecuritySettings securitySettings) : base(extensionFactory, securitySettings, !securitySettings.IgnoreUnsignedExtensions) { Requires.NotNull(extensionFactory, "extensionFactory"); Requires.NotNull(securitySettings, "securitySettings"); this.relyingPartySecuritySettings = securitySettings; }
/// <summary> /// Initializes a new instance of the <see cref="ExtensionsBindingElement"/> class. /// </summary> /// <param name="extensionFactory">The extension factory.</param> /// <param name="securitySettings">The security settings.</param> internal ExtensionsBindingElement(IOpenIdExtensionFactory extensionFactory, SecuritySettings securitySettings) { Contract.Requires<ArgumentNullException>(extensionFactory != null); Contract.Requires<ArgumentNullException>(securitySettings != null); this.ExtensionFactory = extensionFactory; this.relyingPartySecuritySettings = securitySettings as RelyingPartySecuritySettings; }
/// <summary> /// Initializes a new instance of the <see cref="ExtensionsBindingElement"/> class. /// </summary> /// <param name="extensionFactory">The extension factory.</param> /// <param name="securitySettings">The security settings.</param> /// <param name="receiveUnsignedExtensions">Security setting for relying parties. Should be true for Providers.</param> internal ExtensionsBindingElement(IOpenIdExtensionFactory extensionFactory, SecuritySettings securitySettings, bool receiveUnsignedExtensions) { Requires.NotNull(extensionFactory, "extensionFactory"); Requires.NotNull(securitySettings, "securitySettings"); this.ExtensionFactory = extensionFactory; this.receiveUnsignedExtensions = receiveUnsignedExtensions; }
/// <summary> /// Initializes a new instance of the <see cref="ExtensionsBindingElement"/> class. /// </summary> /// <param name="extensionFactory">The extension factory.</param> /// <param name="securitySettings">The security settings.</param> internal ExtensionsBindingElement(IOpenIdExtensionFactory extensionFactory, SecuritySettings securitySettings) { Contract.Requires <ArgumentNullException>(extensionFactory != null); Contract.Requires <ArgumentNullException>(securitySettings != null); this.ExtensionFactory = extensionFactory; this.relyingPartySecuritySettings = securitySettings as RelyingPartySecuritySettings; }
/// <summary> /// Initializes a new instance of the <see cref="ExtensionsBindingElement"/> class. /// </summary> /// <param name="extensionFactory">The extension factory.</param> /// <param name="securitySettings">The security settings.</param> internal ExtensionsBindingElement(IOpenIdExtensionFactory extensionFactory, SecuritySettings securitySettings) { ErrorUtilities.VerifyArgumentNotNull(extensionFactory, "extensionFactory"); ErrorUtilities.VerifyArgumentNotNull(securitySettings, "securitySettings"); this.ExtensionFactory = extensionFactory; this.relyingPartySecuritySettings = securitySettings as RelyingPartySecuritySettings; }
/// <summary> /// Initializes a new instance of the <see cref="ExtensionsBindingElement"/> class. /// </summary> /// <param name="extensionFactory">The extension factory.</param> /// <param name="securitySettings">The security settings to apply.</param> internal ExtensionsBindingElement(IOpenIdExtensionFactory extensionFactory, ProviderSecuritySettings securitySettings) { ErrorUtilities.VerifyArgumentNotNull(extensionFactory, "extensionFactory"); ErrorUtilities.VerifyArgumentNotNull(securitySettings, "securitySettings"); this.ExtensionFactory = extensionFactory; this.opSecuritySettings = securitySettings; }
/// <summary> /// Initializes a new instance of the <see cref="ExtensionsBindingElementRelyingParty"/> class. /// </summary> /// <param name="extensionFactory">The extension factory.</param> /// <param name="securitySettings">The security settings.</param> internal ExtensionsBindingElementRelyingParty(IOpenIdExtensionFactory extensionFactory, RelyingPartySecuritySettings securitySettings) : base(extensionFactory, securitySettings, !securitySettings.IgnoreUnsignedExtensions) { Requires.NotNull(extensionFactory, "extensionFactory"); Requires.NotNull(securitySettings, "securitySettings"); this.relyingPartySecuritySettings = securitySettings; }
/// <summary> /// Gets the extension factories from the extension aggregator on an OpenID channel. /// </summary> /// <param name="channel">The channel.</param> /// <returns>The list of factories that will be used to generate extension instances.</returns> /// <remarks> /// This is an extension method on <see cref="Channel"/> rather than an instance /// method on <see cref="OpenIdChannel"/> because the <see cref="OpenIdRelyingParty"/> /// and <see cref="OpenIdProvider"/> classes don't strong-type to <see cref="OpenIdChannel"/> /// to allow flexibility in the specific type of channel the user (or tests) /// can plug in. /// </remarks> internal static IList <IOpenIdExtensionFactory> GetExtensionFactories(this Channel channel) { Contract.Requires <ArgumentNullException>(channel != null); var extensionsBindingElement = channel.BindingElements.OfType <ExtensionsBindingElement>().SingleOrDefault(); ErrorUtilities.VerifyOperation(extensionsBindingElement != null, OpenIdStrings.UnsupportedChannelConfiguration); IOpenIdExtensionFactory factory = extensionsBindingElement.ExtensionFactory; var aggregator = factory as OpenIdExtensionFactoryAggregator; ErrorUtilities.VerifyOperation(aggregator != null, OpenIdStrings.UnsupportedChannelConfiguration); return(aggregator.Factories); }