3

I have an ASP.NET MVC app running on IIS 7.5 with an app pool which identity is set to "roger01".

I'd like to make sure when I render @User.Idenity.Name it's that identity (roger01) that's displayed.

I tried using ASP impersonation but it's not compatible with Integrated mode. And ASP.NET MVC requires integrated mode.

I also set the Anonymous Authentication identity to "roger01" but it doesn't change anything.

I actually tried lot of things for a few hours I'm not even able to enumerate...

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Serge Profafilecebook
  • 1,165
  • 1
  • 14
  • 32

1 Answers1

0

This answer looks like it might accomplish what you're after.

The identity of an application pool in IIS

When creating a new application pool, it’s often convenient to be able to identify the identity the pool is using. The issue arises usually on IIS 7/7.5 where default application pools use identities of a form IIS APPPOOL\identityname. And when you grant access to databases/file system you have to provide the identity name in an exact form.

Usually I tend to use this simple script. Just copy it into a text file, name it test.aspx and point your browser to it. The application pool’s identity name will be presented to you in a clear way.

<%@ Page Language="C#" %>
 
Current user: <%= System.Security.Principal.WindowsIdentity.GetCurrent().Name %>

via Get the Application Pool Identity programmatically

Community
  • 1
  • 1
JSuar
  • 21,056
  • 4
  • 39
  • 83