.net DotNetOpenAuth RequestUserAuthorization回调

.net DotNetOpenAuth RequestUserAuthorization回调,.net,dotnetopenauth,.net,Dotnetopenauth,我正在尝试获取具有以下内容的用户授权令牌: public static void RequestAuthorization(WebConsumer consumer) { if (consumer == null) throw new ArgumentNullException("consumer"); Uri callback = new Uri("http://www.ihighfive.com/"); //test url until app is external

我正在尝试获取具有以下内容的用户授权令牌:

public static void RequestAuthorization(WebConsumer consumer)
{
    if (consumer == null) throw new ArgumentNullException("consumer");

    Uri callback = new Uri("http://www.ihighfive.com/"); //test url until app is external

    var extraParams = new Dictionary<string, string> { 
        //need to pass this as extra, but leave the value blank
        { "oauth_token", string.Empty} 
    };

    var req = consumer.PrepareRequestUserAuthorization(callback, extraParams, null);    
    consumer.Channel.Send(req);
}
如果我修改上述代码并手动包含oauth_回调参数,我会得到更有利的结果

var extraParams = new Dictionary<string, string> { 
    //need to pass this as extra, but leave the value blank
    { "oauth_token", string.Empty},
    { "oauth_callback", "http://www.ihighfive.com/" },
};
var extraParams=新字典{
//需要将其作为额外值传递,但将值留空
{“oauth_标记”,string.Empty},
{“oauth_回调”http://www.ihighfive.com/" },
};
因此,将回调参数传递给.PrepareRequestUserAuthorization()似乎不包括请求中的oauth_回调。我是否错误地使用了回调参数

--编辑--


进一步的调查表明,如果ServiceProviderDescription设置为ProtocolVersion.V10,则不会包含oauth_回调参数。如果设置为ProtocolVersion.V10a,或者根本没有设置,oauth_回调将包含在请求中。

如果您的问题是“为什么oauth_回调没有自动包含”,那么您进一步的调查就是答案。这是OAuth 1.0a中添加的一个新参数,因此当您将版本设置为1.0时,该参数将被忽略。

这些问题的可能副本都试图与同一端点通信,但我认为它们可能是不同的问题。
var extraParams = new Dictionary<string, string> { 
    //need to pass this as extra, but leave the value blank
    { "oauth_token", string.Empty},
    { "oauth_callback", "http://www.ihighfive.com/" },
};