diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2011-07-02 20:04:57 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2011-07-02 20:04:57 -0700 |
commit | ac7b3b8bd58a220bb1d9e310456e75f601b99b58 (patch) | |
tree | a232dca840de2c5175f576dc612a31b77bf9ea80 | |
parent | 4faaa016aeccd6aa78a4095021fe67328a57c9fe (diff) | |
download | DotNetOpenAuth-ac7b3b8bd58a220bb1d9e310456e75f601b99b58.zip DotNetOpenAuth-ac7b3b8bd58a220bb1d9e310456e75f601b99b58.tar.gz DotNetOpenAuth-ac7b3b8bd58a220bb1d9e310456e75f601b99b58.tar.bz2 |
OpenID project now builds.
* Many of the resource items (resx, png) are improperly declared in the project file.
21 files changed, 148 insertions, 91 deletions
diff --git a/src/DotNetOpenAuth.Messaging/Properties/AssemblyInfo.cs b/src/DotNetOpenAuth.Messaging/Properties/AssemblyInfo.cs index d3b6963..84f899b 100644 --- a/src/DotNetOpenAuth.Messaging/Properties/AssemblyInfo.cs +++ b/src/DotNetOpenAuth.Messaging/Properties/AssemblyInfo.cs @@ -54,7 +54,13 @@ using System.Web.UI; [assembly: InternalsVisibleTo("DotNetOpenAuth.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100AD093C3765257C89A7010E853F2C7C741FF92FA8ACE06D7B8254702CAD5CF99104447F63AB05F8BB6F51CE0D81C8C93D2FCE8C20AAFF7042E721CBA16EAAE98778611DED11C0ABC8900DC5667F99B50A9DADEC24DBD8F2C91E3E8AD300EF64F1B4B9536CEB16FB440AF939F57624A9B486F867807C649AE4830EAB88C6C03998")] [assembly: InternalsVisibleTo("DotNetOpenAuth.InfoCard, PublicKey=0024000004800000940000000602000000240000525341310004000001000100AD093C3765257C89A7010E853F2C7C741FF92FA8ACE06D7B8254702CAD5CF99104447F63AB05F8BB6F51CE0D81C8C93D2FCE8C20AAFF7042E721CBA16EAAE98778611DED11C0ABC8900DC5667F99B50A9DADEC24DBD8F2C91E3E8AD300EF64F1B4B9536CEB16FB440AF939F57624A9B486F867807C649AE4830EAB88C6C03998")] +[assembly: InternalsVisibleTo("DotNetOpenAuth.OpenID, PublicKey=0024000004800000940000000602000000240000525341310004000001000100AD093C3765257C89A7010E853F2C7C741FF92FA8ACE06D7B8254702CAD5CF99104447F63AB05F8BB6F51CE0D81C8C93D2FCE8C20AAFF7042E721CBA16EAAE98778611DED11C0ABC8900DC5667F99B50A9DADEC24DBD8F2C91E3E8AD300EF64F1B4B9536CEB16FB440AF939F57624A9B486F867807C649AE4830EAB88C6C03998")] +[assembly: InternalsVisibleTo("DotNetOpenAuth.OAuth, PublicKey=0024000004800000940000000602000000240000525341310004000001000100AD093C3765257C89A7010E853F2C7C741FF92FA8ACE06D7B8254702CAD5CF99104447F63AB05F8BB6F51CE0D81C8C93D2FCE8C20AAFF7042E721CBA16EAAE98778611DED11C0ABC8900DC5667F99B50A9DADEC24DBD8F2C91E3E8AD300EF64F1B4B9536CEB16FB440AF939F57624A9B486F867807C649AE4830EAB88C6C03998")] +[assembly: InternalsVisibleTo("DotNetOpenAuth.OAuth2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100AD093C3765257C89A7010E853F2C7C741FF92FA8ACE06D7B8254702CAD5CF99104447F63AB05F8BB6F51CE0D81C8C93D2FCE8C20AAFF7042E721CBA16EAAE98778611DED11C0ABC8900DC5667F99B50A9DADEC24DBD8F2C91E3E8AD300EF64F1B4B9536CEB16FB440AF939F57624A9B486F867807C649AE4830EAB88C6C03998")] #else [assembly: InternalsVisibleTo("DotNetOpenAuth.Test")] [assembly: InternalsVisibleTo("DotNetOpenAuth.InfoCard")] +[assembly: InternalsVisibleTo("DotNetOpenAuth.OpenID")] +[assembly: InternalsVisibleTo("DotNetOpenAuth.OAuth")] +[assembly: InternalsVisibleTo("DotNetOpenAuth.OAuth2")] #endif diff --git a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs index 69994e6..19606fa 100644 --- a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs +++ b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs @@ -15,7 +15,12 @@ namespace DotNetOpenAuth.Configuration { /// Represents the <openid> element in the host's .config file. /// </summary> [ContractVerification(true)] - internal class OpenIdElement : ConfigurationElement { + internal class OpenIdElement : ConfigurationSection { + /// <summary> + /// The name of the section under which this library's settings must be found. + /// </summary> + private const string SectionName = "openId"; + /// <summary> /// The name of the <relyingParty> sub-element. /// </summary> @@ -53,6 +58,16 @@ namespace DotNetOpenAuth.Configuration { } /// <summary> + /// Gets the configuration section from the .config file. + /// </summary> + public static OpenIdElement Configuration { + get { + Contract.Ensures(Contract.Result<OpenIdElement>() != null); + return (OpenIdElement)ConfigurationManager.GetSection(SectionName) ?? new OpenIdElement(); + } + } + + /// <summary> /// Gets or sets the maximum time a user can take to complete authentication. /// </summary> /// <remarks> diff --git a/src/DotNetOpenAuth.OpenId/DotNetOpenAuth.OpenId.csproj b/src/DotNetOpenAuth.OpenId/DotNetOpenAuth.OpenId.csproj index ef9f1e5..12b6e1f 100644 --- a/src/DotNetOpenAuth.OpenId/DotNetOpenAuth.OpenId.csproj +++ b/src/DotNetOpenAuth.OpenId/DotNetOpenAuth.OpenId.csproj @@ -290,6 +290,8 @@ http://opensource.org/licenses/ms-pl.html <Compile Include="Mvc\OpenIdHelper.cs" /> <Compile Include="OpenId\Association.cs" /> <Compile Include="OpenId\Provider\AssociationDataBag.cs" /> + <Compile Include="OpenId\Provider\IdentityEndpoint.cs" /> + <Compile Include="OpenId\Provider\IdentityEndpointNormalizationEventArgs.cs" /> <Compile Include="OpenId\Provider\IProviderAssociationStore.cs" /> <Compile Include="OpenId\Provider\ProviderAssociationHandleEncoder.cs" /> <Compile Include="OpenId\Provider\ProviderAssociationKeyStorage.cs" /> @@ -429,7 +431,16 @@ http://opensource.org/licenses/ms-pl.html <Compile Include="OpenId\RelyingParty\IRelyingPartyBehavior.cs" /> <Compile Include="OpenId\RelyingParty\IAuthenticationRequestContract.cs" /> <Compile Include="OpenId\RelyingParty\NegativeAuthenticationResponse.cs" /> + <Compile Include="OpenId\RelyingParty\OpenIdAjaxRelyingParty.cs" /> + <Compile Include="OpenId\RelyingParty\OpenIdAjaxTextBox.cs" /> + <Compile Include="OpenId\RelyingParty\OpenIdButton.cs" /> <Compile Include="OpenId\RelyingParty\OpenIdEventArgs.cs" /> + <Compile Include="OpenId\RelyingParty\OpenIdLogin.cs" /> + <Compile Include="OpenId\RelyingParty\OpenIdMobileTextBox.cs" /> + <Compile Include="OpenId\RelyingParty\OpenIdRelyingPartyAjaxControlBase.cs" /> + <Compile Include="OpenId\RelyingParty\OpenIdRelyingPartyControlBase.cs" /> + <Compile Include="OpenId\RelyingParty\OpenIdSelector.cs" /> + <Compile Include="OpenId\RelyingParty\OpenIdTextBox.cs" /> <Compile Include="OpenId\RelyingParty\PopupBehavior.cs" /> <Compile Include="OpenId\RelyingParty\PositiveAnonymousResponse.cs" /> <Compile Include="OpenId\RelyingParty\PositiveAuthenticationResponse.cs" /> @@ -452,6 +463,10 @@ http://opensource.org/licenses/ms-pl.html <Compile Include="OpenId\RelyingParty\RelyingPartySecuritySettings.cs" /> <Compile Include="OpenId\IdentifierDiscoveryResult.cs" /> <Compile Include="OpenId\OpenIdXrdsHelper.cs" /> + <Compile Include="OpenId\RelyingParty\SelectorButton.cs" /> + <Compile Include="OpenId\RelyingParty\SelectorButtonContract.cs" /> + <Compile Include="OpenId\RelyingParty\SelectorOpenIdButton.cs" /> + <Compile Include="OpenId\RelyingParty\SelectorProviderButton.cs" /> <Compile Include="OpenId\RelyingParty\SimpleXrdsProviderEndpoint.cs" /> <Compile Include="OpenId\RelyingParty\StandardRelyingPartyApplicationStore.cs" /> <Compile Include="OpenId\Behaviors\GsaIcamProfile.cs" /> @@ -478,6 +493,10 @@ http://opensource.org/licenses/ms-pl.html <Compile Include="Xrds\XrdsDocument.cs" /> <Compile Include="Xrds\XrdsNode.cs" /> <Compile Include="Yadis\Yadis.cs" /> + <EmbeddedResource Include="OpenId\Behaviors\BehaviorStrings.resx" /> + <EmbeddedResource Include="OpenId\Behaviors\BehaviorStrings.sr.resx" /> + <EmbeddedResource Include="OpenId\OpenIdStrings.resx" /> + <EmbeddedResource Include="OpenId\OpenIdStrings.sr.resx" /> <EmbeddedResource Include="Xrds\XrdsStrings.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>XrdsStrings.Designer.cs</LastGenOutput> @@ -511,6 +530,23 @@ http://opensource.org/licenses/ms-pl.html <Name>DotNetOpenAuth.Messaging</Name> </ProjectReference> </ItemGroup> + <ItemGroup> + <Content Include="OpenId\RelyingParty\login_failure.png" /> + <Content Include="OpenId\RelyingParty\login_success %28lock%29.png" /> + <Content Include="OpenId\RelyingParty\login_success.png" /> + <Content Include="OpenId\RelyingParty\OpenIdAjaxTextBox.css" /> + <Content Include="OpenId\RelyingParty\OpenIdAjaxTextBox.js" /> + <Content Include="OpenId\RelyingParty\OpenIdRelyingPartyAjaxControlBase.js" /> + <Content Include="OpenId\RelyingParty\OpenIdRelyingPartyControlBase.js" /> + <Content Include="OpenId\RelyingParty\OpenIdSelector.css" /> + <Content Include="OpenId\RelyingParty\OpenIdSelector.js" /> + <Content Include="OpenId\RelyingParty\openid_login.png" /> + <Content Include="OpenId\RelyingParty\spinner.gif" /> + </ItemGroup> + <ItemGroup> + <None Include="OpenId\RelyingParty\Controls.cd" /> + <None Include="OpenId\RelyingParty\OpenIdRelyingParty.cd" /> + </ItemGroup> <PropertyGroup> <!-- Don't sign the non-unified version of the assembly. --> <SuppressTargetPathDelaySignedAssembly>true</SuppressTargetPathDelaySignedAssembly> diff --git a/src/DotNetOpenAuth.OpenId/Mvc/OpenIdHelper.cs b/src/DotNetOpenAuth.OpenId/Mvc/OpenIdHelper.cs index adde6b6..5436837 100644 --- a/src/DotNetOpenAuth.OpenId/Mvc/OpenIdHelper.cs +++ b/src/DotNetOpenAuth.OpenId/Mvc/OpenIdHelper.cs @@ -117,7 +117,7 @@ window.openid_trace = {1}; // causes lots of messages"; // Positive assertions can last no longer than this library is willing to consider them valid, // and when they come with OP private associations they last no longer than the OP is willing // to consider them valid. We assume the OP will hold them valid for at least five minutes. - double assertionLifetimeInMilliseconds = Math.Min(TimeSpan.FromMinutes(5).TotalMilliseconds, Math.Min(DotNetOpenAuthSection.Configuration.OpenId.MaxAuthenticationTime.TotalMilliseconds, DotNetOpenAuthSection.Configuration.Messaging.MaximumMessageLifetime.TotalMilliseconds)); + double assertionLifetimeInMilliseconds = Math.Min(TimeSpan.FromMinutes(5).TotalMilliseconds, Math.Min(OpenIdElement.Configuration.MaxAuthenticationTime.TotalMilliseconds, DotNetOpenAuthSection.Configuration.Messaging.MaximumMessageLifetime.TotalMilliseconds)); blockBuilder.WriteLine( "{0} = {1};", OpenIdRelyingPartyAjaxControlBase.MaxPositiveAssertionLifetimeJsName, diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Association.cs b/src/DotNetOpenAuth.OpenId/OpenId/Association.cs index 5b97ad4..06f920a 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/Association.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/Association.cs @@ -113,7 +113,7 @@ namespace DotNetOpenAuth.OpenId { protected static TimeSpan DumbSecretLifetime { get { Contract.Ensures(Contract.Result<TimeSpan>() > TimeSpan.Zero); - return DotNetOpenAuthSection.Configuration.OpenId.MaxAuthenticationTime; + return OpenIdElement.Configuration.MaxAuthenticationTime; } } @@ -132,7 +132,7 @@ namespace DotNetOpenAuth.OpenId { private static TimeSpan MinimumUsefulAssociationLifetime { get { Contract.Ensures(Contract.Result<TimeSpan>() > TimeSpan.Zero); - return DotNetOpenAuthSection.Configuration.OpenId.MaxAuthenticationTime; + return OpenIdElement.Configuration.MaxAuthenticationTime; } } diff --git a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ReturnToSignatureBindingElement.cs b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ReturnToSignatureBindingElement.cs index 30358e0..15b6fc4 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ReturnToSignatureBindingElement.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ReturnToSignatureBindingElement.cs @@ -102,7 +102,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements { public MessageProtections? ProcessOutgoingMessage(IProtocolMessage message) { SignedResponseRequest request = message as SignedResponseRequest; if (request != null && request.ReturnTo != null && request.SignReturnTo) { - var cryptoKeyPair = this.cryptoKeyStore.GetCurrentKey(SecretUri.AbsoluteUri, DotNetOpenAuthSection.Configuration.OpenId.MaxAuthenticationTime); + var cryptoKeyPair = this.cryptoKeyStore.GetCurrentKey(SecretUri.AbsoluteUri, OpenIdElement.Configuration.MaxAuthenticationTime); request.AddReturnToArguments(ReturnToSignatureHandleParameterName, cryptoKeyPair.Key); string signature = Convert.ToBase64String(this.GetReturnToSignature(request.ReturnTo, cryptoKeyPair.Value)); request.AddReturnToArguments(ReturnToSignatureParameterName, signature); diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/OpenIdExtensionFactoryAggregator.cs b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/OpenIdExtensionFactoryAggregator.cs index 05e6687..95dd2c9 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/OpenIdExtensionFactoryAggregator.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/OpenIdExtensionFactoryAggregator.cs @@ -71,7 +71,7 @@ namespace DotNetOpenAuth.OpenId.Extensions { /// <returns>A new instance of <see cref="OpenIdExtensionFactoryAggregator"/>.</returns> internal static OpenIdExtensionFactoryAggregator LoadFromConfiguration() { Contract.Ensures(Contract.Result<OpenIdExtensionFactoryAggregator>() != null); - var factoriesElement = DotNetOpenAuth.Configuration.DotNetOpenAuthSection.Configuration.OpenId.ExtensionFactories; + var factoriesElement = DotNetOpenAuth.Configuration.OpenIdElement.Configuration.ExtensionFactories; var aggregator = new OpenIdExtensionFactoryAggregator(); aggregator.Factories.Add(new StandardOpenIdExtensionFactory()); aggregator.factories.AddRange(factoriesElement.CreateInstances(false)); diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Provider/OpenIdProvider.cs b/src/DotNetOpenAuth.OpenId/OpenId/Provider/OpenIdProvider.cs index 58dfc2f..ea19202 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/Provider/OpenIdProvider.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/Provider/OpenIdProvider.cs @@ -54,7 +54,7 @@ namespace DotNetOpenAuth.OpenId.Provider { /// Initializes a new instance of the <see cref="OpenIdProvider"/> class. /// </summary> public OpenIdProvider() - : this(DotNetOpenAuthSection.Configuration.OpenId.Provider.ApplicationStore.CreateInstance(HttpApplicationStore)) { + : this(OpenIdElement.Configuration.Provider.ApplicationStore.CreateInstance(HttpApplicationStore)) { Contract.Ensures(this.SecuritySettings != null); Contract.Ensures(this.Channel != null); } @@ -81,9 +81,9 @@ namespace DotNetOpenAuth.OpenId.Provider { Contract.Ensures(this.SecuritySettings != null); Contract.Ensures(this.Channel != null); - this.SecuritySettings = DotNetOpenAuthSection.Configuration.OpenId.Provider.SecuritySettings.CreateSecuritySettings(); + this.SecuritySettings = OpenIdElement.Configuration.Provider.SecuritySettings.CreateSecuritySettings(); this.behaviors.CollectionChanged += this.OnBehaviorsChanged; - foreach (var behavior in DotNetOpenAuthSection.Configuration.OpenId.Provider.Behaviors.CreateInstances(false)) { + foreach (var behavior in OpenIdElement.Configuration.Provider.Behaviors.CreateInstances(false)) { this.behaviors.Add(behavior); } diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Provider/ProviderEndpoint.cs b/src/DotNetOpenAuth.OpenId/OpenId/Provider/ProviderEndpoint.cs index 821d95c..90dedc2 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/Provider/ProviderEndpoint.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/Provider/ProviderEndpoint.cs @@ -261,7 +261,7 @@ namespace DotNetOpenAuth.OpenId.Provider { /// <returns>The new instance of OpenIdProvider.</returns> private static OpenIdProvider CreateProvider() { Contract.Ensures(Contract.Result<OpenIdProvider>() != null); - return new OpenIdProvider(DotNetOpenAuthSection.Configuration.OpenId.Provider.ApplicationStore.CreateInstance(OpenIdProvider.HttpApplicationStore)); + return new OpenIdProvider(OpenIdElement.Configuration.Provider.ApplicationStore.CreateInstance(OpenIdProvider.HttpApplicationStore)); } } } diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Provider/StandardProviderApplicationStore.cs b/src/DotNetOpenAuth.OpenId/OpenId/Provider/StandardProviderApplicationStore.cs index c13c4bc..b5880d3 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/Provider/StandardProviderApplicationStore.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/Provider/StandardProviderApplicationStore.cs @@ -37,7 +37,7 @@ namespace DotNetOpenAuth.OpenId.Provider { /// Initializes a new instance of the <see cref="StandardProviderApplicationStore"/> class. /// </summary> public StandardProviderApplicationStore() { - this.nonceStore = new NonceMemoryStore(DotNetOpenAuthSection.Configuration.OpenId.MaxAuthenticationTime); + this.nonceStore = new NonceMemoryStore(OpenIdElement.Configuration.MaxAuthenticationTime); this.cryptoKeyStore = new MemoryCryptoKeyStore(); } diff --git a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/AuthenticationRequest.cs b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/AuthenticationRequest.cs index 8bbf04f..d79038c 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/AuthenticationRequest.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/AuthenticationRequest.cs @@ -554,7 +554,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { request.AssociationHandle = association != null ? association.Handle : null; request.SignReturnTo = this.returnToArgsMustBeSigned; request.AddReturnToArguments(this.returnToArgs); - if (this.DiscoveryResult.UserSuppliedIdentifier != null && DotNetOpenAuthSection.Configuration.OpenId.RelyingParty.PreserveUserSuppliedIdentifier) { + if (this.DiscoveryResult.UserSuppliedIdentifier != null && OpenIdElement.Configuration.RelyingParty.PreserveUserSuppliedIdentifier) { request.AddReturnToArguments(UserSuppliedIdentifierParameterName, this.DiscoveryResult.UserSuppliedIdentifier.OriginalString); } foreach (IOpenIdMessageExtension extension in this.extensions) { diff --git a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdAjaxRelyingParty.cs b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdAjaxRelyingParty.cs index 652fa6b..42bfbde 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdAjaxRelyingParty.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdAjaxRelyingParty.cs @@ -92,7 +92,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { req.SetUntrustedCallbackArgument("index", (reqIndex++).ToString(CultureInfo.InvariantCulture)); // If the ReturnToUrl was explicitly set, we'll need to reset our first parameter - if (DotNetOpenAuthSection.Configuration.OpenId.RelyingParty.PreserveUserSuppliedIdentifier) { + if (OpenIdElement.Configuration.RelyingParty.PreserveUserSuppliedIdentifier) { if (string.IsNullOrEmpty(HttpUtility.ParseQueryString(req.ReturnToUrl.Query)[AuthenticationRequest.UserSuppliedIdentifierParameterName])) { req.SetUntrustedCallbackArgument(AuthenticationRequest.UserSuppliedIdentifierParameterName, userSuppliedIdentifier.OriginalString); } diff --git a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdMobileTextBox.cs b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdMobileTextBox.cs index 9cafb74..fc80b32 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdMobileTextBox.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdMobileTextBox.cs @@ -760,7 +760,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { // is one. Then try the configuration file specified one. Finally, use the default // in-memory one that's built into OpenIdRelyingParty. IOpenIdApplicationStore store = this.Stateless ? null : - (this.CustomApplicationStore ?? DotNetOpenAuthSection.Configuration.OpenId.RelyingParty.ApplicationStore.CreateInstance(OpenIdRelyingParty.HttpApplicationStore)); + (this.CustomApplicationStore ?? OpenIdElement.Configuration.RelyingParty.ApplicationStore.CreateInstance(OpenIdRelyingParty.HttpApplicationStore)); var rp = new OpenIdRelyingParty(store); try { // Only set RequireSsl to true, as we don't want to override diff --git a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdRelyingParty.cs b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdRelyingParty.cs index aec59b8..290d29e 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdRelyingParty.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdRelyingParty.cs @@ -93,7 +93,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// Initializes a new instance of the <see cref="OpenIdRelyingParty"/> class. /// </summary> public OpenIdRelyingParty() - : this(DotNetOpenAuthSection.Configuration.OpenId.RelyingParty.ApplicationStore.CreateInstance(HttpApplicationStore)) { + : this(OpenIdElement.Configuration.RelyingParty.ApplicationStore.CreateInstance(HttpApplicationStore)) { } /// <summary> @@ -116,14 +116,14 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { // If we're a dumb-mode RP, then 2.0 OPs are responsible for preventing replays. Contract.Requires<ArgumentException>(cryptoKeyStore == null || nonceStore != null, OpenIdStrings.AssociationStoreRequiresNonceStore); - this.securitySettings = DotNetOpenAuthSection.Configuration.OpenId.RelyingParty.SecuritySettings.CreateSecuritySettings(); + this.securitySettings = OpenIdElement.Configuration.RelyingParty.SecuritySettings.CreateSecuritySettings(); - foreach (var discoveryService in DotNetOpenAuthSection.Configuration.OpenId.RelyingParty.DiscoveryServices.CreateInstances(true)) { + foreach (var discoveryService in OpenIdElement.Configuration.RelyingParty.DiscoveryServices.CreateInstances(true)) { this.discoveryServices.Add(discoveryService); } this.behaviors.CollectionChanged += this.OnBehaviorsChanged; - foreach (var behavior in DotNetOpenAuthSection.Configuration.OpenId.RelyingParty.Behaviors.CreateInstances(false)) { + foreach (var behavior in OpenIdElement.Configuration.RelyingParty.Behaviors.CreateInstances(false)) { this.behaviors.Add(behavior); } diff --git a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs index 551534a..04f8d54 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs @@ -386,7 +386,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { // Positive assertions can last no longer than this library is willing to consider them valid, // and when they come with OP private associations they last no longer than the OP is willing // to consider them valid. We assume the OP will hold them valid for at least five minutes. - double assertionLifetimeInMilliseconds = Math.Min(TimeSpan.FromMinutes(5).TotalMilliseconds, Math.Min(DotNetOpenAuthSection.Configuration.OpenId.MaxAuthenticationTime.TotalMilliseconds, DotNetOpenAuthSection.Configuration.Messaging.MaximumMessageLifetime.TotalMilliseconds)); + double assertionLifetimeInMilliseconds = Math.Min(TimeSpan.FromMinutes(5).TotalMilliseconds, Math.Min(OpenIdElement.Configuration.MaxAuthenticationTime.TotalMilliseconds, DotNetOpenAuthSection.Configuration.Messaging.MaximumMessageLifetime.TotalMilliseconds)); initScript.AppendLine(MaxPositiveAssertionLifetimeJsName + " = " + assertionLifetimeInMilliseconds.ToString(CultureInfo.InvariantCulture) + ";"); // We register this callback code explicitly with a specific type rather than the derived-type of the control diff --git a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs index b1106e6..16ea839 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs @@ -792,7 +792,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// </summary> /// <returns>The instantiated relying party.</returns> protected OpenIdRelyingParty CreateRelyingParty() { - IOpenIdApplicationStore store = this.Stateless ? null : DotNetOpenAuthSection.Configuration.OpenId.RelyingParty.ApplicationStore.CreateInstance(OpenIdRelyingParty.HttpApplicationStore); + IOpenIdApplicationStore store = this.Stateless ? null : OpenIdElement.Configuration.RelyingParty.ApplicationStore.CreateInstance(OpenIdRelyingParty.HttpApplicationStore); return this.CreateRelyingParty(store); } diff --git a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdSelector.cs b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdSelector.cs index 538e181..ae1037b 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdSelector.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/OpenIdSelector.cs @@ -22,7 +22,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using DotNetOpenAuth.ComponentModel; - using DotNetOpenAuth.InfoCard; + ////using DotNetOpenAuth.InfoCard; using DotNetOpenAuth.Messaging; /// <summary> @@ -85,15 +85,15 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { public OpenIdSelector() { } - /// <summary> - /// Occurs when an InfoCard has been submitted and decoded. - /// </summary> - public event EventHandler<ReceivedTokenEventArgs> ReceivedToken; + /////// <summary> + /////// Occurs when an InfoCard has been submitted and decoded. + /////// </summary> + ////public event EventHandler<ReceivedTokenEventArgs> ReceivedToken; - /// <summary> - /// Occurs when [token processing error]. - /// </summary> - public event EventHandler<TokenProcessingErrorEventArgs> TokenProcessingError; + /////// <summary> + /////// Occurs when [token processing error]. + /////// </summary> + ////public event EventHandler<TokenProcessingErrorEventArgs> TokenProcessingError; /// <summary> /// Gets the text box where applicable. @@ -270,15 +270,15 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { return; } - var selectorButton = this.Buttons.OfType<SelectorInfoCardButton>().FirstOrDefault(); - if (selectorButton != null) { - var selector = selectorButton.InfoCardSelector; - selector.ClaimsRequested.Add(new ClaimType { Name = ClaimTypes.PPID }); - selector.ImageSize = InfoCardImageSize.Size60x42; - selector.ReceivedToken += this.InfoCardSelector_ReceivedToken; - selector.TokenProcessingError += this.InfoCardSelector_TokenProcessingError; - this.Controls.Add(selector); - } + ////var selectorButton = this.Buttons.OfType<SelectorInfoCardButton>().FirstOrDefault(); + ////if (selectorButton != null) { + //// var selector = selectorButton.InfoCardSelector; + //// selector.ClaimsRequested.Add(new ClaimType { Name = ClaimTypes.PPID }); + //// selector.ImageSize = InfoCardImageSize.Size60x42; + //// selector.ReceivedToken += this.InfoCardSelector_ReceivedToken; + //// selector.TokenProcessingError += this.InfoCardSelector_TokenProcessingError; + //// this.Controls.Add(selector); + ////} this.textBox = new OpenIdAjaxTextBox(); this.textBox.ID = "openid_identifier"; @@ -391,54 +391,54 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { this.positiveAssertionField.RenderControl(writer); } - /// <summary> - /// Fires the <see cref="ReceivedToken"/> event. - /// </summary> - /// <param name="e">The token, if it was decrypted.</param> - protected virtual void OnReceivedToken(ReceivedTokenEventArgs e) { - Contract.Requires(e != null); - ErrorUtilities.VerifyArgumentNotNull(e, "e"); - - var receivedInfoCard = this.ReceivedToken; - if (receivedInfoCard != null) { - receivedInfoCard(this, e); - } - } - - /// <summary> - /// Raises the <see cref="E:TokenProcessingError"/> event. - /// </summary> - /// <param name="e">The <see cref="DotNetOpenAuth.InfoCard.TokenProcessingErrorEventArgs"/> instance containing the event data.</param> - protected virtual void OnTokenProcessingError(TokenProcessingErrorEventArgs e) { - Contract.Requires(e != null); - ErrorUtilities.VerifyArgumentNotNull(e, "e"); - - var tokenProcessingError = this.TokenProcessingError; - if (tokenProcessingError != null) { - tokenProcessingError(this, e); - } - } - - /// <summary> - /// Handles the ReceivedToken event of the infoCardSelector control. - /// </summary> - /// <param name="sender">The source of the event.</param> - /// <param name="e">The <see cref="DotNetOpenAuth.InfoCard.ReceivedTokenEventArgs"/> instance containing the event data.</param> - private void InfoCardSelector_ReceivedToken(object sender, ReceivedTokenEventArgs e) { - this.Page.Response.SetCookie(new HttpCookie("openid_identifier", "infocard") { - Path = this.Page.Request.ApplicationPath, - }); - this.OnReceivedToken(e); - } - - /// <summary> - /// Handles the TokenProcessingError event of the infoCardSelector control. - /// </summary> - /// <param name="sender">The source of the event.</param> - /// <param name="e">The <see cref="DotNetOpenAuth.InfoCard.TokenProcessingErrorEventArgs"/> instance containing the event data.</param> - private void InfoCardSelector_TokenProcessingError(object sender, TokenProcessingErrorEventArgs e) { - this.OnTokenProcessingError(e); - } + /////// <summary> + /////// Fires the <see cref="ReceivedToken"/> event. + /////// </summary> + /////// <param name="e">The token, if it was decrypted.</param> + ////protected virtual void OnReceivedToken(ReceivedTokenEventArgs e) { + //// Contract.Requires(e != null); + //// ErrorUtilities.VerifyArgumentNotNull(e, "e"); + + //// var receivedInfoCard = this.ReceivedToken; + //// if (receivedInfoCard != null) { + //// receivedInfoCard(this, e); + //// } + ////} + + /////// <summary> + /////// Raises the <see cref="E:TokenProcessingError"/> event. + /////// </summary> + /////// <param name="e">The <see cref="DotNetOpenAuth.InfoCard.TokenProcessingErrorEventArgs"/> instance containing the event data.</param> + ////protected virtual void OnTokenProcessingError(TokenProcessingErrorEventArgs e) { + //// Contract.Requires(e != null); + //// ErrorUtilities.VerifyArgumentNotNull(e, "e"); + + //// var tokenProcessingError = this.TokenProcessingError; + //// if (tokenProcessingError != null) { + //// tokenProcessingError(this, e); + //// } + ////} + + /////// <summary> + /////// Handles the ReceivedToken event of the infoCardSelector control. + /////// </summary> + /////// <param name="sender">The source of the event.</param> + /////// <param name="e">The <see cref="DotNetOpenAuth.InfoCard.ReceivedTokenEventArgs"/> instance containing the event data.</param> + ////private void InfoCardSelector_ReceivedToken(object sender, ReceivedTokenEventArgs e) { + //// this.Page.Response.SetCookie(new HttpCookie("openid_identifier", "infocard") { + //// Path = this.Page.Request.ApplicationPath, + //// }); + //// this.OnReceivedToken(e); + ////} + + /////// <summary> + /////// Handles the TokenProcessingError event of the infoCardSelector control. + /////// </summary> + /////// <param name="sender">The source of the event.</param> + /////// <param name="e">The <see cref="DotNetOpenAuth.InfoCard.TokenProcessingErrorEventArgs"/> instance containing the event data.</param> + ////private void InfoCardSelector_TokenProcessingError(object sender, TokenProcessingErrorEventArgs e) { + //// this.OnTokenProcessingError(e); + ////} /// <summary> /// Ensures the <see cref="Buttons"/> collection has a valid set of buttons. diff --git a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/StandardRelyingPartyApplicationStore.cs b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/StandardRelyingPartyApplicationStore.cs index f17b260..a14b55d 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/StandardRelyingPartyApplicationStore.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/RelyingParty/StandardRelyingPartyApplicationStore.cs @@ -30,7 +30,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// Initializes a new instance of the <see cref="StandardRelyingPartyApplicationStore"/> class. /// </summary> public StandardRelyingPartyApplicationStore() { - this.nonceStore = new NonceMemoryStore(DotNetOpenAuthSection.Configuration.OpenId.MaxAuthenticationTime); + this.nonceStore = new NonceMemoryStore(OpenIdElement.Configuration.MaxAuthenticationTime); this.keyStore = new MemoryCryptoKeyStore(); } diff --git a/src/DotNetOpenAuth.OpenId/OpenId/UriIdentifier.cs b/src/DotNetOpenAuth.OpenId/OpenId/UriIdentifier.cs index 145a394..3bbf343 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/UriIdentifier.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/UriIdentifier.cs @@ -477,8 +477,8 @@ namespace DotNetOpenAuth.OpenId { /// <returns>The non-compressing equivalent scheme or URL for the given value.</returns> private static string NormalSchemeToSpecialRoundTrippingScheme(string normal) { Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(normal)); - Contract.Requires<InternalErrorException>(schemeSubstitution); Contract.Ensures(!string.IsNullOrEmpty(Contract.Result<string>())); + ErrorUtilities.VerifyInternal(schemeSubstitution, "Wrong schemeSubstitution value."); int delimiterIndex = normal.IndexOf(Uri.SchemeDelimiter, StringComparison.Ordinal); string normalScheme = delimiterIndex < 0 ? normal : normal.Substring(0, delimiterIndex); diff --git a/src/DotNetOpenAuth.OpenId/OpenId/XriDiscoveryProxyService.cs b/src/DotNetOpenAuth.OpenId/OpenId/XriDiscoveryProxyService.cs index b1a3430..d80c59e 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/XriDiscoveryProxyService.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/XriDiscoveryProxyService.cs @@ -89,7 +89,7 @@ namespace DotNetOpenAuth.OpenId { /// <param name="identifier">The identifier.</param> /// <returns>The URI to HTTP GET from to get the services.</returns> private static Uri GetXrdsUrl(XriIdentifier identifier) { - ErrorUtilities.VerifyProtocol(DotNetOpenAuthSection.Configuration.OpenId.XriResolver.Enabled, OpenIdStrings.XriResolutionDisabled); + ErrorUtilities.VerifyProtocol(OpenIdElement.Configuration.XriResolver.Enabled, OpenIdStrings.XriResolutionDisabled); string xriResolverProxy = XriResolverProxyTemplate; if (identifier.IsDiscoverySecureEndToEnd) { // Indicate to xri.net that we require SSL to be used for delegated resolution @@ -102,7 +102,7 @@ namespace DotNetOpenAuth.OpenId { CultureInfo.InvariantCulture, xriResolverProxy, identifier, - DotNetOpenAuthSection.Configuration.OpenId.XriResolver.Proxy.Name)); + OpenIdElement.Configuration.XriResolver.Proxy.Name)); } } } diff --git a/src/DotNetOpenAuth.OpenId/Yadis/Yadis.cs b/src/DotNetOpenAuth.OpenId/Yadis/Yadis.cs index 357dd8d..0f46c5e 100644 --- a/src/DotNetOpenAuth.OpenId/Yadis/Yadis.cs +++ b/src/DotNetOpenAuth.OpenId/Yadis/Yadis.cs @@ -32,7 +32,7 @@ namespace DotNetOpenAuth.Yadis { #if DEBUG internal static readonly RequestCachePolicy IdentifierDiscoveryCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.BypassCache); #else - internal static readonly RequestCachePolicy IdentifierDiscoveryCachePolicy = new HttpRequestCachePolicy(DotNetOpenAuthSection.Configuration.OpenId.CacheDiscovery ? HttpRequestCacheLevel.CacheIfAvailable : HttpRequestCacheLevel.BypassCache); + internal static readonly RequestCachePolicy IdentifierDiscoveryCachePolicy = new HttpRequestCachePolicy(OpenIdElement.Configuration.CacheDiscovery ? HttpRequestCacheLevel.CacheIfAvailable : HttpRequestCacheLevel.BypassCache); #endif /// <summary> |