在 .NET 中跨多个网站/应用程序对用户进行身份验证的最简单方法
我能想到的方法是:
- 使用 Windows Identity Foundation (WIF)。我从来没有这样做过,所以这是一个黑匣子并且有风险。
- 使用表单身份验证或类似方法,然后使用数据库复制来确保每个应用程序都可以访问数据存储。
毫无疑问还有其他选择。
更多信息:这是一个互联网解决方案,而不是内联网/局域网
The ways I can think of are:
- Use Windows Identity Foundation (WIF). I have never done this so is a black box and risky.
- Use Forms Authentication or similar, then use database replication to make sure each application has access to the data store.
No doubt there are other options.
More info: This is for an internet solution, not intranet/LAN
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我使用 DotNetOpenAuth 取得了巨大成功。 StackOverflow 使用它。 http://dotnetopenauth.net
I have had good success using DotNetOpenAuth. StackOverflow uses it. http://dotnetopenauth.net
我一直在使用 Windows Identity Foundation。当然,文档很差。
不过,看起来真正很棒的是“基于声明的身份验证”。它基本上允许登录系统授予“声明”,这些声明基本上是描述用户的信息字符串。这些声明是使用私钥签名的,因此依赖的 .net 应用程序可以识别这些声明是真实的。
此外,您可以使用有关用户的任何底层信息存储(SQL、AD),并且存储有关授权用户的信息的方法完全从您的应用程序中抽象出来。有一天,您可以从 SQL 切换到 AD,如果设置正确,依赖的 .net 应用程序将收到完全相同的声明,并且永远不会知道其中的差异。
I've been using Windows Identity Foundation. Sure, the documentation is poor.
What seems really great though, is the "claims-based authentication". It basically allows the logon system to grant "claims", which are basically strings of information that describe the user. The claims are signed with a private key so the relying .net application can recognize that the claims are authentic.
Furthermore, you can use any underlying store of information about your users ( SQL, AD ) and the method of storing information about authorized users is entirely abstracted from your application. You could switch from SQL to AD one day and if the set up is correct, the relying .net application would receive the exact same claims and never know the difference.
如果您对基于声明的方法感兴趣(这将带来各种有趣的机会,例如联合等),请查看“声明身份指南”:http://msdn.microsoft.com/en-us/library/ff423674.aspx
尤金尼奥
If you are interested in claims based approach (which will open all kind of interesting opportunities like federation, etc), take a look at the "claims identity guide": http://msdn.microsoft.com/en-us/library/ff423674.aspx
Eugenio
此 HowTo 应该让您了解如何对实例执行用户身份验证AD 的,以防您的身份验证背后有一个域。
WCF 只是一种跨通信网络进行通信的方式,因此您不妨通过 WCF 对 AD 进行身份验证。
我希望这会有所帮助!
This HowTo should give you an idea of how to perform user authentication against an instance of AD, in case you have a domain behind your authentication.
WCF is simply a way to communicate accross communication networks, so you might as well be able to authenticate against AD through WCF.
I do hope this helps!
ASP.NET 会员服务是一个不错的选择。它允许您使用数据库、Active Directory 或您自己的自定义身份验证来支持它。
http://msdn.microsoft.com/en-us /library/yh26yfzy(VS.85).aspx
它不仅限于网站,还可以在通过 Web 服务公开时从 Silverlight 和 WPF 使用。
另请参阅 OpenID/OpenAuth 甚至 Facebook Connect,以使用单一登录对多个网站/应用程序进行身份验证。
ASP.NET Membership Services is a good option. It allows you to back it with a database, Active Directory or your own custom authentication.
http://msdn.microsoft.com/en-us/library/yh26yfzy(VS.85).aspx
It's not limited to just websites, but can be used from Silverlight and WPF when exposed via web services.
Also look at OpenID/OpenAuth and even Facebook Connect for using a single login for authenticating against multiple websites/applications.