开发者

ASP .NET - Get username on Windows Server 2003 (Terminal Service)?

开发者 https://www.devze.com 2022-12-09 23:32 出处:网络
On a intranet ASP .NET (C#) page I am trying to retrieve the current username. From my local machine (Firefox 3.5) I can see results (from my local login) for the following possibilities:

On a intranet ASP .NET (C#) page I am trying to retrieve the current username.

From my local machine (Firefox 3.5) I can see results (from my local login) for the following possibilities:

<% Response.Write(User.Identity.Name); %>
<% Response.Write(HttpContext.Current.User.Identity.Name); %>
<% Resp开发者_StackOverflowonse.Write(Page.User.Identity.Name); %>

However when I browse locally(IE8) or on the server (IE7) none of the above work for my terminal server login.

Is this a permission issue between IE and the webpage?

UPDATE1

Just tested the same page on the Terminal Server with Firefox portable and it also blocks the username.


IE - forgive me for the vagueness of this answer, I haven't used it in a long time: there's a setting in IE for enabling the passing of usernames. That may be off due to Group Policies.

Thinking out loud...

Firefox would normally not work if the site used native Windows security. So, is it using text-based logon (do you actually have to log on from within Firefox?)? That would explain Firefox working.

Local browsing/server browsing: Normal browsing (internal browsing) normally doesn't bounce off a proxy server. It may be the case where the TS is configured to know this and why credentials are being passed correctly (for example, can you browse through TS using IE - does it work? Same group policy settings apply.) I've seen installations where all traffic is pushed through a proxy server, then back to internal servers. Unfortunately, this tends to strip credentials and that may be happening here, too.

What will help are the IIS logs. Do you see the failed IE traffic (403'd, I think)?


Hmm couple of setting you could check:

1) Internet Options > Security > (Choose your Zone) > Custom level... > User Authentication > Logon > Automatic logon with current user name and password

and/or

2) Internet Options > Advanced > Enable Integrated Windows Authentication

0

精彩评论

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