我如何连接到OAuth的在C#中? [英] How do I connect to OAuth in C#?

查看:229
本文介绍了我如何连接到OAuth的在C#中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于一个项目,我想创建一个不使用令牌消费的作用。

For a project I am trying to create a consumer role that does not utilise tokens.

我已成功地创建了code-背后所需的详细信息:

I have managed to create the required details in the code-behind:

        string outUrl = "";
    string querystring = "";

    string consumerKey = "";
    string consumerSecret = "";
    Uri uri = new Uri("");

    oAuthBase2 oAuth = new oAuthBase2();
    string nonce = oAuth.GenerateNonce();
    string timeStamp = oAuth.GenerateTimeStamp();

    string sig = oAuth.GenerateSignature(uri, consumerKey, consumerSecret, string.Empty, string.Empty,
        "POST", timeStamp, nonce, oAuthBase2.SignatureTypes.HMACSHA1, out outUrl,
        out querystring);

我在哪里何去何从?

Where do I go from here?

推荐答案

您的第一站应该是的OAuth规范。这正好说明了每个步骤是。如果你想使用 DotNetOpenAuth (易最完整的OAuth库.NET)的OAuth的例子中,我<一个href="http://stackoverflow.com/questions/3799323/how-do-i-use-oauth-to-connect-to-the-etrade-api/7904228#7904228">included一个在这里。

Your first stop should be the OAuth specification. It explains exactly what each step is for. If you want an OAuth example using DotNetOpenAuth (easily the most complete OAuth library for .NET), I've included one here.

在DotNetOpenAuth源$ C ​​$ C还含有实例连接到Facebook,Twitter和谷歌。

The DotNetOpenAuth source code also contains examples for connecting to Facebook, Twitter, and Google.

这篇关于我如何连接到OAuth的在C#中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆