AUTH_USER & User.Identity.Name?

G

Guest

Hi,

I have a dev machine, part of a domain, with a site set to Integrated
security only. I want to determine the username of person accessing the
page. When I run the page with the following code:

Response.Write(Request.ServerVariables["AUTH_USER"]);
Response.Write("<BR>");
Response.Write(HttpContext.Current.User.Identity.Name);

It outputs:

DEVSERVERNAME\Administator
DEVSERVERNAME\Administator

but I thought it would be my username ("US" stands for our US domain):

US\dsmith
US\dsmith

I took "dsmith" out of the Administrators group but I still get the
Administrator to appear.

Another user tested the page and she got her credentials displayed back OK.

What am I not getting? Thanks.
 
W

William F. Robertson, Jr.

Are you one the server when you are testing it? Or are you hitting it
remotely. The User.Indentity.Name should display the name you are logged as
on the machine the browser is on.

bill
 
G

Guest

Hi Dave,

Are you sure that you are logged in to windows not as Administrator and
instead with your domain account?


Ethem Azun
 
G

Guest

That's what's weird. I'm browsing it from my desktop and logged in with my
domain account.

William F. Robertson said:
Are you one the server when you are testing it? Or are you hitting it
remotely. The User.Indentity.Name should display the name you are logged as
on the machine the browser is on.

bill

Dave said:
Hi,

I have a dev machine, part of a domain, with a site set to Integrated
security only. I want to determine the username of person accessing the
page. When I run the page with the following code:

Response.Write(Request.ServerVariables["AUTH_USER"]);
Response.Write("<BR>");
Response.Write(HttpContext.Current.User.Identity.Name);

It outputs:

DEVSERVERNAME\Administator
DEVSERVERNAME\Administator

but I thought it would be my username ("US" stands for our US domain):

US\dsmith
US\dsmith

I took "dsmith" out of the Administrators group but I still get the
Administrator to appear.

Another user tested the page and she got her credentials displayed back OK.

What am I not getting? Thanks.
 
W

William F. Robertson, Jr.

That is really strange...I have thought of a couple things to try out.

Add the following section to your web.config on the dev server.
<authorization>
<allow users="us\dsmith" />
<deny users="*" />
</authorization>

It should prompt you for a login box since it is trying to authenticate you
as devserver/administrator. Try to login with your us/dsmith login on the
box and see what happens.

Are you using impersonation on the server?

The identity sent to the webserver comes from the browser settings. It is
at all possible that you have logged in and chose to save password in the
past. Perhaps your IE has cached the username/password and it resending it
to the server.

If this is possibly the case, maybe you could try reseting the administrator
password on your dev server. That way if any user/pass has been cached, it
will fail and prompt you for the login box.

Just shooting in the dark here.

HTH,
bill


Dave said:
That's what's weird. I'm browsing it from my desktop and logged in with my
domain account.

William F. Robertson said:
Are you one the server when you are testing it? Or are you hitting it
remotely. The User.Indentity.Name should display the name you are logged as
on the machine the browser is on.

bill

Dave said:
Hi,

I have a dev machine, part of a domain, with a site set to Integrated
security only. I want to determine the username of person accessing the
page. When I run the page with the following code:

Response.Write(Request.ServerVariables["AUTH_USER"]);
Response.Write("<BR>");
Response.Write(HttpContext.Current.User.Identity.Name);

It outputs:

DEVSERVERNAME\Administator
DEVSERVERNAME\Administator

but I thought it would be my username ("US" stands for our US domain):

US\dsmith
US\dsmith

I took "dsmith" out of the Administrators group but I still get the
Administrator to appear.

Another user tested the page and she got her credentials displayed
back
OK.
What am I not getting? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top