diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/DotNetOpenAuth/OAuth/ConsumerBase.cs | 2 | ||||
-rw-r--r-- | src/DotNetOpenAuth/OAuth/ServiceProviderDescription.cs | 11 |
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> |