summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2011-07-04 14:01:34 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2011-07-04 14:01:34 -0700
commit676f43dbe30070f126c58bf6a369cfa98f9658cd (patch)
tree5f3e74bd0f9af4dede6a98e517ca2a7d77f53d00
parentdcc43f2cb44ed66cb3d52a476c1d29bda517bb0c (diff)
downloadDotNetOpenAuth-676f43dbe30070f126c58bf6a369cfa98f9658cd.zip
DotNetOpenAuth-676f43dbe30070f126c58bf6a369cfa98f9658cd.tar.gz
DotNetOpenAuth-676f43dbe30070f126c58bf6a369cfa98f9658cd.tar.bz2
Fix for 2-legged OAuth.
-rw-r--r--src/DotNetOpenAuth/OAuth/ConsumerBase.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/DotNetOpenAuth/OAuth/ConsumerBase.cs b/src/DotNetOpenAuth/OAuth/ConsumerBase.cs
index d9fa889..ad4e317 100644
--- a/src/DotNetOpenAuth/OAuth/ConsumerBase.cs
+++ b/src/DotNetOpenAuth/OAuth/ConsumerBase.cs
@@ -84,8 +84,9 @@ namespace DotNetOpenAuth.OAuth {
/// The token secret is stored in the <see cref="TokenManager"/>.
/// </remarks>
public string RequestNewClientAccount(IDictionary<string, string> requestParameters = null) {
- // Obtain an unauthorized request token. Assume the OAuth version given in the service description.
- var token = new UnauthorizedTokenRequest(this.ServiceProvider.RequestTokenEndpoint, this.ServiceProvider.Version) {
+ // Obtain an unauthorized request token. Force use of OAuth 1.0 (not 1.0a) so that
+ // we are not expected to provide an oauth_verifier which doesn't apply in 2-legged OAuth.
+ var token = new UnauthorizedTokenRequest(this.ServiceProvider.RequestTokenEndpoint, Protocol.V10.Version) {
ConsumerKey = this.ConsumerKey,
};
var tokenAccessor = this.Channel.MessageDescriptions.GetAccessor(token);
@@ -93,7 +94,7 @@ namespace DotNetOpenAuth.OAuth {
var requestTokenResponse = this.Channel.Request<UnauthorizedTokenResponse>(token);
this.TokenManager.StoreNewRequestToken(token, requestTokenResponse);
- var requestAccess = new AuthorizedTokenRequest(this.ServiceProvider.AccessTokenEndpoint, this.ServiceProvider.Version) {
+ var requestAccess = new AuthorizedTokenRequest(this.ServiceProvider.AccessTokenEndpoint, Protocol.V10.Version) {
RequestToken = requestTokenResponse.RequestToken,
ConsumerKey = this.ConsumerKey,
};