diff options
Diffstat (limited to 'src/DotNetOpenAuth.OpenIdOAuth/OAuth/ServiceProviderOpenIdProvider.cs')
-rw-r--r-- | src/DotNetOpenAuth.OpenIdOAuth/OAuth/ServiceProviderOpenIdProvider.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/DotNetOpenAuth.OpenIdOAuth/OAuth/ServiceProviderOpenIdProvider.cs b/src/DotNetOpenAuth.OpenIdOAuth/OAuth/ServiceProviderOpenIdProvider.cs index b590a90..f827857 100644 --- a/src/DotNetOpenAuth.OpenIdOAuth/OAuth/ServiceProviderOpenIdProvider.cs +++ b/src/DotNetOpenAuth.OpenIdOAuth/OAuth/ServiceProviderOpenIdProvider.cs @@ -9,7 +9,6 @@ namespace DotNetOpenAuth.OAuth { using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; - using System.Diagnostics.Contracts; using System.Globalization; using System.Security.Principal; using System.ServiceModel.Channels; @@ -23,6 +22,7 @@ namespace DotNetOpenAuth.OAuth { using DotNetOpenAuth.OpenId.Extensions.OAuth; using DotNetOpenAuth.OpenId.Messages; using DotNetOpenAuth.OpenId.Provider; + using Validation; /// <summary> /// A web application that allows access via OAuth and can respond to OpenID+OAuth requests. @@ -92,7 +92,7 @@ namespace DotNetOpenAuth.OAuth { /// </remarks> public AuthorizationRequest ReadAuthorizationRequest(IHostProcessedRequest openIdRequest) { Requires.NotNull(openIdRequest, "openIdRequest"); - Requires.ValidState(this.TokenManager is ICombinedOpenIdProviderTokenManager); + RequiresEx.ValidState(this.TokenManager is ICombinedOpenIdProviderTokenManager); var openidTokenManager = this.TokenManager as ICombinedOpenIdProviderTokenManager; ErrorUtilities.VerifyOperation(openidTokenManager != null, OAuthStrings.OpenIdOAuthExtensionRequiresSpecialTokenManagerInterface, typeof(IOpenIdOAuthTokenManager).FullName); @@ -122,8 +122,8 @@ namespace DotNetOpenAuth.OAuth { [Obsolete("Call the overload that doesn't take a consumerKey instead.")] public void AttachAuthorizationResponse(IHostProcessedRequest openIdAuthenticationRequest, string consumerKey, string scope) { Requires.NotNull(openIdAuthenticationRequest, "openIdAuthenticationRequest"); - Requires.True((consumerKey == null) == (scope == null), null); - Requires.ValidState(this.TokenManager is ICombinedOpenIdProviderTokenManager); + Requires.That((consumerKey == null) == (scope == null), null, "consumerKey and scope must either be both provided or both omitted."); + RequiresEx.ValidState(this.TokenManager is ICombinedOpenIdProviderTokenManager); var openidTokenManager = (ICombinedOpenIdProviderTokenManager)this.TokenManager; ErrorUtilities.VerifyArgument(consumerKey == null || consumerKey == openidTokenManager.GetConsumerKey(openIdAuthenticationRequest.Realm), OAuthStrings.OpenIdOAuthRealmConsumerKeyDoNotMatch); @@ -138,7 +138,7 @@ namespace DotNetOpenAuth.OAuth { [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "We want to take IAuthenticationRequest because that's the only supported use case.")] public void AttachAuthorizationResponse(IHostProcessedRequest openIdAuthenticationRequest, string scope) { Requires.NotNull(openIdAuthenticationRequest, "openIdAuthenticationRequest"); - Requires.ValidState(this.TokenManager is ICombinedOpenIdProviderTokenManager); + RequiresEx.ValidState(this.TokenManager is ICombinedOpenIdProviderTokenManager); var openidTokenManager = this.TokenManager as ICombinedOpenIdProviderTokenManager; IOpenIdMessageExtension response; |