diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-12-26 18:07:32 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-12-26 18:07:32 -0800 |
commit | 002ce0e39af3b684ce6060dce60805e3333420fa (patch) | |
tree | 2c9aace23e08d17ed03a3732a5fa4a549463f811 /src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs | |
parent | 4bf6dfa05ab5ba2d7ebff157dc4a1a85dae42125 (diff) | |
download | DotNetOpenAuth-002ce0e39af3b684ce6060dce60805e3333420fa.zip DotNetOpenAuth-002ce0e39af3b684ce6060dce60805e3333420fa.tar.gz DotNetOpenAuth-002ce0e39af3b684ce6060dce60805e3333420fa.tar.bz2 |
Replaces DNOA's internal Requires class with Validation NuGet package.
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs')
-rw-r--r-- | src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs index 879e4e3..491048a 100644 --- a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs +++ b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs @@ -18,6 +18,7 @@ namespace DotNetOpenAuth.OAuth2 { using DotNetOpenAuth.Configuration; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OAuth2.Messages; + using Validation; /// <summary> /// An OAuth 2.0 consumer designed for web applications. @@ -89,8 +90,8 @@ namespace DotNetOpenAuth.OAuth2 { /// <returns>The authorization request.</returns> public OutgoingWebResponse PrepareRequestUserAuthorization(IAuthorizationState authorization) { Requires.NotNull(authorization, "authorization"); - Requires.ValidState(authorization.Callback != null || (HttpContext.Current != null && HttpContext.Current.Request != null), MessagingStrings.HttpContextRequired); - Requires.ValidState(!string.IsNullOrEmpty(this.ClientIdentifier), Strings.RequiredPropertyNotYetPreset, "ClientIdentifier"); + RequiresEx.ValidState(authorization.Callback != null || (HttpContext.Current != null && HttpContext.Current.Request != null), MessagingStrings.HttpContextRequired); + RequiresEx.ValidState(!string.IsNullOrEmpty(this.ClientIdentifier), Strings.RequiredPropertyNotYetPreset, "ClientIdentifier"); Contract.Ensures(Contract.Result<OutgoingWebResponse>() != null); if (authorization.Callback == null) { @@ -136,8 +137,8 @@ namespace DotNetOpenAuth.OAuth2 { /// <param name="request">The incoming HTTP request that may carry an authorization response.</param> /// <returns>The authorization state that contains the details of the authorization.</returns> public IAuthorizationState ProcessUserAuthorization(HttpRequestBase request = null) { - Requires.ValidState(!string.IsNullOrEmpty(this.ClientIdentifier), Strings.RequiredPropertyNotYetPreset, "ClientIdentifier"); - Requires.ValidState(this.ClientCredentialApplicator != null, Strings.RequiredPropertyNotYetPreset, "ClientCredentialApplicator"); + RequiresEx.ValidState(!string.IsNullOrEmpty(this.ClientIdentifier), Strings.RequiredPropertyNotYetPreset, "ClientIdentifier"); + RequiresEx.ValidState(this.ClientCredentialApplicator != null, Strings.RequiredPropertyNotYetPreset, "ClientCredentialApplicator"); if (request == null) { request = this.Channel.GetRequestFromContext(); |