从.NET应用程序登录到一个OpenID的网站应用程序、网站、NET、OpenID

由网友(不能让我们分开)分享简介:我一直在想的,也许写一个小工具,登录到SO并更新我的资料信息与定期一些外用/电流信息(如:我的最新博客文章或我需要帮助的,等问题... )I have been thinking of maybe writing a little tool that logs into SO and updates my profi...

我一直在想的,也许写一个小工具,登录到SO并更新我的资料信息与定期一些外用/电流信息(如:我的最新博客文章或我需要帮助的,等问题... )

I have been thinking of maybe writing a little tool that logs into SO and updates my profile info with some topical/current info on a regular basis (eg. my latest blog post or questions I need help on, etc...)

要得到这个工作,我需要以某种方式上所以从一个控制台应用程序日志。

To get this to work I will need to somehow log on to SO from a console app.

有一个.net库,简化登录到使用原始的HTTP请求一个OpenID的网站?

Is there a .Net library that streamlines logging on to an openid website using raw http requests?

推荐答案

都能跟得上。或者至少,你不能在一般情况下做到这一点。因为在那里你present凭据到您的OpenID提供商可以是任何东西,右边的部分?也许提供商通过令牌或电话或语音身份验证或其他身份验证,这就是OpenID的规范之外。

Nope. Or at least, you can't do it in the general case. Because the part where you present your credentials to your OpenID provider could be anything, right? Maybe the provider authenticates through a token or a phone call or voice auth or whatever, that's outside the OpenID spec.

所以,你有两个选择。一个是让SO提供了更方便的API来编辑您的个人资料,使用一些机制更适合于自动调用(如OAuth的)。

So you've got two options. One is to get SO to provide a more accessible API for editing your profile, using some mechanism better suited to automated calls (e.g. OAuth).

另外就是,如果你正在写这code供个人使用,你可以控制你使用的OpenID提供商,并选择一个是编写脚本。在极端情况下,你可以运行自己的提供者,然后放置任何安全你想你的脚本和您的供应商之间。或者你可以尝试写剧本的东西,如机械化的登录到您目前的供应商。 (只要确保你拥有它可以乖巧相对于隐藏的表单元素和饼干。良好的OpenID提供商可以是非常挑剔的东西,以保护您的帐户免遭跨站请求伪造攻击。)

The other is, if you're writing this code for your personal use, you can control which OpenID provider you're using and choose one that's scriptable. In the extreme case, you could run your own provider an then put whatever security you wanted between your script and your provider. Or you could just try writing a script with something like Mechanize that logged in to your current provider. (Just be sure you have it be well-behaved with respect to hidden form elements and cookies. Good OpenID providers can be very picky about that stuff, to protect your account from cross-site request forgery attacks.)

阅读全文

相关推荐

最新文章