简体   繁体   English

IIS 7.5和ASP.NET凭据

[英]IIS 7.5 and ASP.NET credentials

I need to develop a web application where users sometime need to perform action with different credential (specifically they are standard domain users, and they need to reset password, unlock user and so on). 我需要开发一个Web应用程序,其中用户有时需要使用不同的凭据来执行操作(特别是他们是标准域用户,并且他们需要重置密码,解锁用户等)。 I've planned to create 2 services running with privileged credential (by using ASP.NET Impersonation), and a web portal where users access and invoke services (by using Windows Authentication). 我计划创建2个使用特权证书(通过使用ASP.NET Impersonation)运行的服务,以及一个供用户访问和调用服务(通过使用Windows身份验证)的Web门户。

Before starting implementation I'm testing credential, but I'm getting a bit confused... If I use System.Security.Principal.WindowsIdentity.GetCurrent() to check credential, it seems to be correct in services (DOMAIN\\admin) and wrong in portal (IIS\\APPPOL\\DefaultAppPool), while using User.Identity.Name returns wrong credential in services (DOMAIN\\user doing request) but correct in portal (DOMAIN\\user doing request). 在开始实施之前,我正在测试凭据,但是我有点困惑...如果我使用System.Security.Principal.WindowsIdentity.GetCurrent()来检查凭据,则在服务(DOMAIN \\ admin)中似乎是正确的并在门户网站(IIS \\ APPPOL \\ DefaultAppPool)中出错,而在使用User.Identity.Name时,在服务(DOMAIN \\用户正在执行请求)中返回错误的凭据,但在门户网站(DOMAIN \\ user在进行请求中)则返回正确的凭据。

Why didn't User.Identity.Name return always "final" credential? 为什么User.Identity.Name总是返回“最终”凭证? It seems a bit incoherent... Am I missing something? 似乎有点不连贯...我错过了什么吗?

使用会话而不是User.Identity!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM