diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-02-20 22:18:31 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-02-20 22:18:31 -0800 |
commit | 335402d6dda7a96acab14e7263ef16e06e637d12 (patch) | |
tree | 1f108e239c21dcdc99469d113224afde4ae3cade /src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs | |
parent | 234cf20e86b0ed1d65bca4a61eabb3277e8562c5 (diff) | |
download | DotNetOpenAuth-335402d6dda7a96acab14e7263ef16e06e637d12.zip DotNetOpenAuth-335402d6dda7a96acab14e7263ef16e06e637d12.tar.gz DotNetOpenAuth-335402d6dda7a96acab14e7263ef16e06e637d12.tar.bz2 |
Added scaffolding for OAuth2 unit tests and added the first test for client authorization.
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs')
-rw-r--r-- | src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs index 09f471c..ffcc1ee 100644 --- a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs +++ b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs @@ -71,7 +71,7 @@ namespace DotNetOpenAuth.OAuth2 { public OutgoingWebResponse PrepareRequestUserAuthorization(IAuthorizationState authorization, string state = null) { Requires.NotNull(authorization, "authorization"); Requires.ValidState(authorization.Callback != null || (HttpContext.Current != null && HttpContext.Current.Request != null), MessagingStrings.HttpContextRequired); - Requires.ValidState(!string.IsNullOrEmpty(this.ClientIdentifier)); + Requires.ValidState(!string.IsNullOrEmpty(this.ClientIdentifier), OAuth2Strings.RequiredPropertyNotYetPreset, "ClientIdentifier"); Contract.Ensures(Contract.Result<OutgoingWebResponse>() != null); if (authorization.Callback == null) { @@ -97,8 +97,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(HttpRequestInfo request = null) { - Requires.ValidState(!string.IsNullOrEmpty(this.ClientIdentifier)); - Requires.ValidState(!string.IsNullOrEmpty(this.ClientSecret)); + Requires.ValidState(!string.IsNullOrEmpty(this.ClientIdentifier), OAuth2Strings.RequiredPropertyNotYetPreset, "ClientIdentifier"); + Requires.ValidState(!string.IsNullOrEmpty(this.ClientSecret), OAuth2Strings.RequiredPropertyNotYetPreset, "ClientSecret"); if (request == null) { request = this.Channel.GetRequestFromContext(); |