开发者

Get the username that runs the executing AppPool

In ASP.NET or WCF is it safe to use ServiceSecurityContext.Current.WindowsIdentity.Nameto get the current username that 开发者_JS百科executes the current thread?

I want to ensure that the correct user is impersonated in my WCF Service.


WindowsIdentity.GetCurrent().Name

is probably a better alternative, as I don't think that ServiceSecurityContext.Current is available in ASP.NET.

You may also want to consider

Thread.CurrentPrincipal.Identity.Name

if you care about the user instead of the process identity.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜