设置 OpenID 提供程序以进行测试
我正在开发一个使用 OpenID 进行身份验证的网站,该网站运行良好,但是......我经常在没有互联网连接的情况下旅行时使用它。如果会话过期并且我需要再次登录,则在再次建立连接之前我无法登录。
我想做的是在本地 IIS 上设置一个非常愚蠢的 OpenID 提供程序,我可以用它在断开连接时登录。我所说的“真正愚蠢”就是这样的——它只需要是一个硬编码的 URL,可以作为 openID 提供者正确响应并允许登录。
我快速浏览了 DotNetOpenAuth 中包含的 OpenIdProviderMvc 示例,但它没有立即编译(无法解析程序集 ApplicationServices)。在我深入研究之前,我认为有人可能已经经历过这个过程。
I'm developing a site that uses OpenID for authentication, which is working fine however... I often work on it while travelling without an internet connection. If the session expires and I need to login again, I can't until I have connectivity again.
What I'd like to do is setup a really dumb OpenID provider on a local IIS, that I can use to login while disconnected. By really dumb I mean just that - it just needs to be a hard coded URL that responds correctly as an openID provider and allows login.
I've had a quick look at the OpenIdProviderMvc sample included with DotNetOpenAuth, but it didn't compile out of the box (couldn't resolve assembly ApplicationServices). Before I dig in deeper, I thought someone might have already been through this process.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以我想通了。 DotNetOpenAuth 中包含的 OpenIdProviderMvc 示例项目运行良好。
我遇到的主要问题是依赖方站点需要将本地主机列入白名单,如下所示:
在
web.config
的configSections
部分中:并将其作为新配置部分:
如果您有兴趣,我还组装了一个更简单的提供程序“localid”,它可以让您使用 OpenID 登录,如下所示:
http://localid/member/anythingyoulike
。没有登录屏幕,只有无限的有效 OpenID 标识符数组。更多信息请点击此处。So I figured this out. The OpenIdProviderMvc sample project included in DotNetOpenAuth works fine.
Main thing that I got stuck on is that the relying party site needs to have localhost whitelisted as follows:
In the
configSections
section ofweb.config
:And this as a new config section:
If you're interested, I've also knocked together an even more dumbed down provider "localid" which let you login using an OpenID like this:
http://localid/member/anythingyoulike
. No login screens, just an infinite array of valid OpenID identifiers. More info here.