summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-06-09 21:49:27 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2009-06-09 21:49:27 -0700
commit20e1ff638edac9e9522e71467ae09d60f77c91d6 (patch)
tree39ca629d0fcb336ff26d2276712320b9fe0b7d77 /src
parent392d487b5d5d62b032ae591bdfd1cb2a352273b2 (diff)
downloadDotNetOpenAuth-20e1ff638edac9e9522e71467ae09d60f77c91d6.zip
DotNetOpenAuth-20e1ff638edac9e9522e71467ae09d60f77c91d6.tar.gz
DotNetOpenAuth-20e1ff638edac9e9522e71467ae09d60f77c91d6.tar.bz2
Revised ServiceProviderDescription.Version to use ProtocolVersion instead of Version.
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth/OAuth/ConsumerBase.cs2
-rw-r--r--src/DotNetOpenAuth/OAuth/ServiceProviderDescription.cs11
2 files changed, 10 insertions, 3 deletions
diff --git a/src/DotNetOpenAuth/OAuth/ConsumerBase.cs b/src/DotNetOpenAuth/OAuth/ConsumerBase.cs
index d97a51b..8c4484b 100644
--- a/src/DotNetOpenAuth/OAuth/ConsumerBase.cs
+++ b/src/DotNetOpenAuth/OAuth/ConsumerBase.cs
@@ -209,7 +209,7 @@ namespace DotNetOpenAuth.OAuth {
// Fine-tune our understanding of the SP's supported OAuth version if it's wrong.
if (this.ServiceProvider.Version != requestTokenResponse.Version) {
Logger.OAuth.WarnFormat("Expected OAuth service provider at endpoint {0} to use OAuth {1} but {2} was detected. Adjusting service description to new version.", this.ServiceProvider.RequestTokenEndpoint, this.ServiceProvider.Version, requestTokenResponse.Version);
- this.ServiceProvider.Version = requestTokenResponse.Version;
+ this.ServiceProvider.ProtocolVersion = Protocol.Lookup(requestTokenResponse.Version).ProtocolVersion;
}
// Request user authorization. The OAuth version will automatically include
diff --git a/src/DotNetOpenAuth/OAuth/ServiceProviderDescription.cs b/src/DotNetOpenAuth/OAuth/ServiceProviderDescription.cs
index bdfd10d..9014762 100644
--- a/src/DotNetOpenAuth/OAuth/ServiceProviderDescription.cs
+++ b/src/DotNetOpenAuth/OAuth/ServiceProviderDescription.cs
@@ -26,13 +26,13 @@ namespace DotNetOpenAuth.OAuth {
/// Initializes a new instance of the <see cref="ServiceProviderDescription"/> class.
/// </summary>
public ServiceProviderDescription() {
- this.Version = Protocol.Default.Version;
+ this.ProtocolVersion = Protocol.Default.ProtocolVersion;
}
/// <summary>
/// Gets or sets the OAuth version supported by the Service Provider.
/// </summary>
- public Version Version { get; set; }
+ public ProtocolVersion ProtocolVersion { get; set; }
/// <summary>
/// Gets or sets the URL used to obtain an unauthorized Request Token,
@@ -83,6 +83,13 @@ namespace DotNetOpenAuth.OAuth {
public ITamperProtectionChannelBindingElement[] TamperProtectionElements { get; set; }
/// <summary>
+ /// Gets the OAuth version supported by the Service Provider.
+ /// </summary>
+ internal Version Version {
+ get { return Protocol.Lookup(this.ProtocolVersion).Version; }
+ }
+
+ /// <summary>
/// Creates a signing element that includes all the signing elements this service provider supports.
/// </summary>
/// <returns>The created signing element.</returns>