diff options
Diffstat (limited to 'src/DotNetOpenAuth.OpenId')
3 files changed, 52 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.OpenId/Configuration/HostMetaDiscoveryElement.cs b/src/DotNetOpenAuth.OpenId/Configuration/HostMetaDiscoveryElement.cs new file mode 100644 index 0000000..437b12f --- /dev/null +++ b/src/DotNetOpenAuth.OpenId/Configuration/HostMetaDiscoveryElement.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="HostMetaDiscoveryElement.cs" company="Andrew Arnott"> +// Copyright (c) Andrew Arnott. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +namespace DotNetOpenAuth.Configuration { + using System.Configuration; + + /// <summary> + /// The configuration element that can adjust how hostmeta discovery works. + /// </summary> + internal class HostMetaDiscoveryElement : ConfigurationElement { + /// <summary> + /// The property name for enableCertificateValidationCache. + /// </summary> + private const string EnableCertificateValidationCacheConfigName = "enableCertificateValidationCache"; + + /// <summary> + /// Initializes a new instance of the <see cref="HostMetaDiscoveryElement"/> class. + /// </summary> + public HostMetaDiscoveryElement() { + } + + /// <summary> + /// Gets or sets a value indicating whether validated certificates should be cached and not validated again. + /// </summary> + /// <remarks> + /// This helps to avoid unexplained 5-10 second delays in certificate validation for Google Apps for Domains that impact some servers. + /// </remarks> + [ConfigurationProperty(EnableCertificateValidationCacheConfigName, DefaultValue = false)] + public bool EnableCertificateValidationCache { + get { return (bool)this[EnableCertificateValidationCacheConfigName]; } + set { this[EnableCertificateValidationCacheConfigName] = value; } + } + } +} diff --git a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdRelyingPartyElement.cs b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdRelyingPartyElement.cs index 7d8c050..8af1129 100644 --- a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdRelyingPartyElement.cs +++ b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdRelyingPartyElement.cs @@ -47,6 +47,11 @@ namespace DotNetOpenAuth.Configuration { private const string DiscoveryServicesElementName = "discoveryServices"; /// <summary> + /// The name of the <hostMetaDiscovery> sub-element. + /// </summary> + private const string HostMetaDiscoveryElementName = "hostMetaDiscovery"; + + /// <summary> /// The built-in set of identifier discovery services. /// </summary> private static readonly TypeConfigurationCollection<IIdentifierDiscoveryService> defaultDiscoveryServices = @@ -99,6 +104,15 @@ namespace DotNetOpenAuth.Configuration { } /// <summary> + /// Gets or sets the host meta discovery configuration element. + /// </summary> + [ConfigurationProperty(HostMetaDiscoveryElementName)] + internal HostMetaDiscoveryElement HostMetaDiscovery { + get { return (HostMetaDiscoveryElement)this[HostMetaDiscoveryElementName] ?? new HostMetaDiscoveryElement(); } + set { this[HostMetaDiscoveryElementName] = value; } + } + + /// <summary> /// Gets or sets the services to use for discovering service endpoints for identifiers. /// </summary> /// <remarks> diff --git a/src/DotNetOpenAuth.OpenId/DotNetOpenAuth.OpenId.csproj b/src/DotNetOpenAuth.OpenId/DotNetOpenAuth.OpenId.csproj index 95dccc1..75bd113 100644 --- a/src/DotNetOpenAuth.OpenId/DotNetOpenAuth.OpenId.csproj +++ b/src/DotNetOpenAuth.OpenId/DotNetOpenAuth.OpenId.csproj @@ -22,6 +22,7 @@ <ItemGroup> <Compile Include="Configuration\AssociationTypeCollection.cs" /> <Compile Include="Configuration\AssociationTypeElement.cs" /> + <Compile Include="Configuration\HostMetaDiscoveryElement.cs" /> <Compile Include="Configuration\OpenIdElement.cs" /> <Compile Include="Configuration\OpenIdProviderElement.cs" /> <Compile Include="Configuration\OpenIdProviderSecuritySettingsElement.cs" /> |