使用 ASP.NET 和表单身份验证的 Cryptography.ProtectedData CurrentUser
如果通过 ProtectedData CurrentUser 使用加密,并且我有一个使用 Forms auth 的网站(带有自定义会员模块,不认为这会产生影响),它是否可以在多个不同的 Web 服务器上工作?
我的猜测是,如果当前使用的用户是 User.Identity,就会出现这种情况,因为这将是登录用户,并且在任何 Web 服务器上都相同。
该文档似乎没有提及任何有关与 ASP.NET 一起使用的信息。
If encryption is used via ProtectedData CurrentUser and I have a site using Forms auth (with a custom membership module, don't think that will make a difference), will it work across several different web servers?
My guess would be that it would if the current user that is used is the User.Identity, 'cause that will be the logged in user, and will be the same on any web server.
The docs didn't seem to say anything about it working with ASP.NET.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“当前用户”将是运行 ASP.NET 应用程序的用户(而不是访问该站点的用户)。通常这是 /ASPNET 用户帐户,但可以更改。您可以使用
WindowsIdentity.GetCurrent()
函数验证这一点。您的另一个选择是使用 DataProtectionScope.LocalMachine 将其存储在计算机存储中(可以从计算机上的任何帐户访问)。虽然如果您使用非特权帐户(例如 ASPNET 用户),那么这似乎不太安全,但任何人都可以编写应用程序以该用户身份运行并获得对该用户存储的访问权限。
The "current user" will be the user the asp.net application is running as (not the user accessing the site). Typically this is /ASPNET user account however it can be changed. You can verify this with the
WindowsIdentity.GetCurrent()
function.Your other option is to use
DataProtectionScope.LocalMachine
to store it in the machine store instead (acceisslble from any account on the machine). While this may seem less secure member if you are using an unprivileged account (like ASPNET user) than anyone could write an app to run as that user and gain access to that user store.