EYoung
asked on
Current user's login name not appearing on intranet ASP page
I am new to ASP.net 4 and have written a simple web site application. I am trying to display the user's name on the first page of the site with a "Welcome..." message. When I click Ctrl+F5 on my development computer from within VS 2010, the page renders correctly and shows the Welcome message but when I transfer the Web Site to our company's intranet, the page does display but the Welcome message does not show.
Here is the code I have in the Default.aspx page:
<div style="position:absolute; top:130px; left:825px; z-index: 1; visibility:visible; height: 20px; width: 300px; text-align:right;">
<asp:LoginName id="LoginName1" runat="server"
FormatString ="Welcome: {0}" />
</div>
Here is a link from Microsoft:
http://msdn.microsoft.com/en-us/library/ms178344.aspx
It says:
"The current user's login name will appear only if the user has been authenticated. If the user has not logged in, the control is not rendered."
So why when I start an IE browser window from my workstation and display our intranet web site, the Welcome message is blank? How do I fix this? I want to display a Welcome message with the user's name.
Also, when the Welcome message does display from within VS 2010, it shows our company's domain name followed by "\" followed by the user name. For example I see: "Welcome: CorpABC\eyoung". I prefer to see "Welcome: E Young". I do not want the domain/CorpABC name or slash to appear.
Thank you for the help.
Here is the code I have in the Default.aspx page:
<div style="position:absolute; top:130px; left:825px; z-index: 1; visibility:visible; height: 20px; width: 300px; text-align:right;">
<asp:LoginName id="LoginName1" runat="server"
FormatString ="Welcome: {0}" />
</div>
Here is a link from Microsoft:
http://msdn.microsoft.com/en-us/library/ms178344.aspx
It says:
"The current user's login name will appear only if the user has been authenticated. If the user has not logged in, the control is not rendered."
So why when I start an IE browser window from my workstation and display our intranet web site, the Welcome message is blank? How do I fix this? I want to display a Welcome message with the user's name.
Also, when the Welcome message does display from within VS 2010, it shows our company's domain name followed by "\" followed by the user name. For example I see: "Welcome: CorpABC\eyoung". I prefer to see "Welcome: E Young". I do not want the domain/CorpABC name or slash to appear.
Thank you for the help.
ASKER
saranyannara…: I checked the link and here is what I now have in my Default.aspx.vb:
Imports System.DirectoryServices.A ccountMana gement
Partial Class _Default
Inherits System.Web.UI.Page
Public mUserName As String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
mUserName = UserPrincipal.Current.Disp layName
Catch
If Err.Number <> 0 Then
mUserName = ""
End If
End Try
End Sub
End Class
Here is what I have in my Default.aspx:
<form runat="server">
<div style="position:absolute; top:130px; left:825px; z-index: 1; visibility:visible; height: 20px; width: 300px; text-align:right;">
<p>mUserName</p>
</div>
...
Something is still wrong as the literal "mUserName" just appears instead of the actual user name. Any suggestions?
Imports System.DirectoryServices.A
Partial Class _Default
Inherits System.Web.UI.Page
Public mUserName As String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
mUserName = UserPrincipal.Current.Disp
Catch
If Err.Number <> 0 Then
mUserName = ""
End If
End Try
End Sub
End Class
Here is what I have in my Default.aspx:
<form runat="server">
<div style="position:absolute; top:130px; left:825px; z-index: 1; visibility:visible; height: 20px; width: 300px; text-align:right;">
<p>mUserName</p>
</div>
...
Something is still wrong as the literal "mUserName" just appears instead of the actual user name. Any suggestions?
whats the output please? Does it show same in VS and ie or browser?
ASKER
In both VS 2010 and in am IE browser the mUserName field shows as "mUserName". Just those 9 letters show up in both cases as the output on the screens, not the user's name which is what I want.
I think I am not using the publically declared variable, mUserName, correctly in my ASP page. See previous post for how I am defining and initializing mUserName and how I am displaying it.
I am new to ASP.net so I may be doing something wrong.
I think I am not using the publically declared variable, mUserName, correctly in my ASP page. See previous post for how I am defining and initializing mUserName and how I am displaying it.
I am new to ASP.net so I may be doing something wrong.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, that did it. Thank you for the help.
Great that you got the solution , just now got to check the question. Good luck.
ASKER
I spoke too soon. The solution works fine when I run it from my development computer using VS 2010, but after I transfer it to our company's intranet web site, I get the following error:
Server Error in '/' Application.
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30451: 'UserPrincipal' is not declared. It may be inaccessible due to its protection level.
Source Error:
Line 9: Try
Line 10: 'mUserName = "Welcome: " & UserPrincipal.Current.Disp layName
Line 11: mUserName = UserPrincipal.Current.Disp layName
Line 12: Catch
Line 13: If Err.Number <> 0 Then
Source File: C:\inetpub\wwwroot\Default .aspx.vb Line: 11
Can you tell why this is happening on the host web site and not my computer?
Server Error in '/' Application.
--------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30451: 'UserPrincipal' is not declared. It may be inaccessible due to its protection level.
Source Error:
Line 9: Try
Line 10: 'mUserName = "Welcome: " & UserPrincipal.Current.Disp
Line 11: mUserName = UserPrincipal.Current.Disp
Line 12: Catch
Line 13: If Err.Number <> 0 Then
Source File: C:\inetpub\wwwroot\Default
Can you tell why this is happening on the host web site and not my computer?
Here is the code in my Default.aspx.vb:
Imports System.DirectoryServices.AccountManagement
Partial Class _Default
Inherits System.Web.UI.Page
Public mUserName As String
Public Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
' mUserName = UserPrincipal.Current.DisplayName
mUserName = UserPrincipal.Current.DisplayName
Catch
If Err.Number <> 0 Then
mUserName = ""
End If
End Try
End Sub
End Class
=================================================================================
And here is the code that shows the mUserName variable on the ASP.net page:
...
<form runat="server">
<div style="position:absolute; top:113px; left:825px; z-index: 1; visibility:visible; height: 20px; width: 300px; text-align:right;">
<p>Welcome:  <%=mUserName%></p>
</div>
...
please try changing to this :
mUserName = System.Web.HttpContext.Cur rent.User. Identity.D isplayName
mUserName = System.Web.HttpContext.Cur
Are you using impersonation for your website?
and what authentication are you using?
ASKER
I had to change ".DisplayName" to ".Name" because ".DisplayName" is not a valid member of Identity.
After doing that, the name appears with the domain name / user name. I can pull out the user name later.
However, nothing appears on the intranet page when it is displayed except for the "Welcome:".
I need to leave for the day in a few minutes. Can we pick this back up tomorrow?
Thank you
After doing that, the name appears with the domain name / user name. I can pull out the user name later.
However, nothing appears on the intranet page when it is displayed except for the "Welcome:".
I need to leave for the day in a few minutes. Can we pick this back up tomorrow?
Thank you
ASKER
I don't understand what you mean by impersonation for the website.
Also, I don't follow you regarding authentication that I am using.
I am new to web programming but have many years with vb.net windows programming. I am probably overlooking something simple.
Also, I don't follow you regarding authentication that I am using.
I am new to web programming but have many years with vb.net windows programming. I am probably overlooking something simple.
Sure we can pick up tomorrow.
How do your users logon to the site? via a form ? automatically via windows authentication. In IIS if you go into the security tab of the website what are the settings there?
How do your users logon to the site? via a form ? automatically via windows authentication. In IIS if you go into the security tab of the website what are the settings there?
ASKER
Users start Internet Explorer 7 or 8 depending on which one is installed on their computer. They then type in the url for the company's intranet web site, i.e. http://tta-intranet/
There is no login required as all employees have access to the company's intranet once they login to their computer using their Windows user name and password. So yes I think it is automatically via windows authentication.
Here are the IIS settings:
The Authentication settings are:
Anonymous Authentication is Enabled
ASP.NET Impersonation is Disabled
Forms Authentication is Disabled
I can't find the Security tab for the website. I can right click on the "Default Web Site" (where I put all of the code and pages), then select Edit Permissions, then click on a Security tab but that only shows the control each group or user name has. Is that what you are looking for?
I have to leave now but will be back in tomorrow around 8:30 a.m. PDT (California, US)
Thank you for your help.
There is no login required as all employees have access to the company's intranet once they login to their computer using their Windows user name and password. So yes I think it is automatically via windows authentication.
Here are the IIS settings:
The Authentication settings are:
Anonymous Authentication is Enabled
ASP.NET Impersonation is Disabled
Forms Authentication is Disabled
I can't find the Security tab for the website. I can right click on the "Default Web Site" (where I put all of the code and pages), then select Edit Permissions, then click on a Security tab but that only shows the control each group or user name has. Is that what you are looking for?
I have to leave now but will be back in tomorrow around 8:30 a.m. PDT (California, US)
Thank you for your help.
Your problem is because the website has Anonymous Authentication Enabled
see here : http://msdn.microsoft.com/ en-us/libr ary/Aa3023 77
see here : http://msdn.microsoft.com/
ASKER
When I change Anonymous Authentication from Enabled to Disabled, an error message is generated that says:
Error Summary
HTTP Error 401.2 - Unauthorized
You are not authorized to view this page due to invalid authentication headers.
Detailed Error Information
Module IIS Web Core
Notification AuthenticateRequest
Handler StaticFile
Error Code 0x80070005
Requested URL http://localhost:80/
Physical Path C:\inetpub\wwwroot
Logon Method Not yet determined
Logon User Not yet determined
Most likely causes:
•No authentication protocol (including anonymous) is selected in IIS.
•Only integrated authentication is enabled, and a client browser was used that does not support integrated authentication.
•Integrated authentication is enabled and the request was sent through a proxy that changed the authentication headers before they reach the Web server.
•The Web server is not configured for anonymous access and a required authorization header was not received.
•The "configuration/system.webS erver/auth orization" configuration section may be explicitly denying the user access.
Things you can try:
•Verify the authentication setting for the resource and then try requesting the resource using that authentication method.
•Verify that the client browser supports Integrated authentication.
•Verify that the request is not going through a proxy when Integrated authentication is used.
•Verify that the user is not explicitly denied access in the "configuration/system.webS erver/auth orization" configuration section.
•Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
Links and More InformationThis error occurs when the WWW-Authenticate header sent to the Web server is not supported by the server configuration. Check the authentication method for the resource, and verify which authentication method the client used. The error occurs when the authentication methods are different. To determine which type of authentication the client is using, check the authentication settings for the client.
View more information »
Microsoft Knowledge Base Articles:
•907273
•253667
Error Summary
HTTP Error 401.2 - Unauthorized
You are not authorized to view this page due to invalid authentication headers.
Detailed Error Information
Module IIS Web Core
Notification AuthenticateRequest
Handler StaticFile
Error Code 0x80070005
Requested URL http://localhost:80/
Physical Path C:\inetpub\wwwroot
Logon Method Not yet determined
Logon User Not yet determined
Most likely causes:
•No authentication protocol (including anonymous) is selected in IIS.
•Only integrated authentication is enabled, and a client browser was used that does not support integrated authentication.
•Integrated authentication is enabled and the request was sent through a proxy that changed the authentication headers before they reach the Web server.
•The Web server is not configured for anonymous access and a required authorization header was not received.
•The "configuration/system.webS
Things you can try:
•Verify the authentication setting for the resource and then try requesting the resource using that authentication method.
•Verify that the client browser supports Integrated authentication.
•Verify that the request is not going through a proxy when Integrated authentication is used.
•Verify that the user is not explicitly denied access in the "configuration/system.webS
•Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
Links and More InformationThis error occurs when the WWW-Authenticate header sent to the Web server is not supported by the server configuration. Check the authentication method for the resource, and verify which authentication method the client used. The error occurs when the authentication methods are different. To determine which type of authentication the client is using, check the authentication settings for the client.
View more information »
Microsoft Knowledge Base Articles:
•907273
•253667
ASKER
Regarding this "Most likely causes" message:
"Only integrated authentication is enabled, and a client browser was used that does not support integrated authentication."
I checked my IE8 and integrated authentication is enabled. So I am guessing that maybe Integrated Authentication is not enabled in IIS 7.5. When I look at the list of Authentications in IIS, there are only the three authentications as previously listed. Integrated Authentication is not one of the options.
Any idea?
"Only integrated authentication is enabled, and a client browser was used that does not support integrated authentication."
I checked my IE8 and integrated authentication is enabled. So I am guessing that maybe Integrated Authentication is not enabled in IIS 7.5. When I look at the list of Authentications in IIS, there are only the three authentications as previously listed. Integrated Authentication is not one of the options.
Any idea?
Please check the Event viewer to see the details on the machine
eventwr from run command on the IIS 7 machine should show you errors which show some details
eventwr from run command on the IIS 7 machine should show you errors which show some details
see if this helps : http://technet.microsoft.c om/en-us/l ibrary/cc7 54628(WS.1 0).aspx
ASKER
I have looked all over the Event Viewer and can not find where the error message appears. Any idea where to look?
which version of Windows are you using?
It should be in Application Security or System as an error.
You can try hitting the website once again and check the eventviewer.
It should be in Application Security or System as an error.
You can try hitting the website once again and check the eventviewer.
ASKER
The Web Server is using Windows 2008 R2.
Here is the latest message:
An account was successfully logged on.
Subject:
Security ID: NULL SID
Account Name: -
Account Domain: -
Logon ID: 0x0
Logon Type: 3
New Logon:
Security ID: TTACORP\lfordon
Account Name: lfordon
Account Domain: TTACORP
Logon ID: 0x198f25e
Logon GUID: {0f5e768d-3522-ee1a-7629-e 56702def3b 8}
Process Information:
Process ID: 0x0
Process Name: -
Network Information:
Workstation Name:
Source Network Address: 172.16.7.154
Source Port: 1664
Detailed Authentication Information:
Logon Process: Kerberos
Authentication Package: Kerberos
Transited Services: -
Package Name (NTLM only): -
Key Length: 0
This event is generated when a logon session is created. It is generated on the computer that was accessed.
The subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.
The logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network).
The New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on.
The network fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.
The authentication information fields provide detailed information about this specific logon request.
- Logon GUID is a unique identifier that can be used to correlate this event with a KDC event.
- Transited services indicate which intermediate services have participated in this logon request.
- Package name indicates which sub-protocol was used among the NTLM protocols.
- Key length indicates the length of the generated session key. This will be 0 if no session key was requested.
Here is the latest message:
An account was successfully logged on.
Subject:
Security ID: NULL SID
Account Name: -
Account Domain: -
Logon ID: 0x0
Logon Type: 3
New Logon:
Security ID: TTACORP\lfordon
Account Name: lfordon
Account Domain: TTACORP
Logon ID: 0x198f25e
Logon GUID: {0f5e768d-3522-ee1a-7629-e
Process Information:
Process ID: 0x0
Process Name: -
Network Information:
Workstation Name:
Source Network Address: 172.16.7.154
Source Port: 1664
Detailed Authentication Information:
Logon Process: Kerberos
Authentication Package: Kerberos
Transited Services: -
Package Name (NTLM only): -
Key Length: 0
This event is generated when a logon session is created. It is generated on the computer that was accessed.
The subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.
The logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network).
The New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on.
The network fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.
The authentication information fields provide detailed information about this specific logon request.
- Logon GUID is a unique identifier that can be used to correlate this event with a KDC event.
- Transited services indicate which intermediate services have participated in this logon request.
- Package name indicates which sub-protocol was used among the NTLM protocols.
- Key length indicates the length of the generated session key. This will be 0 if no session key was requested.
ASKER
Here is the "Logon" event:
The logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network).
The New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on.
The network fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.
The authentication information fields provide detailed information about this specific logon request.
- Logon GUID is a unique identifier that can be used to correlate this event with a KDC event.
- Transited services indicate which intermediate services have participated in this logon request.
- Package name indicates which sub-protocol was used among the NTLM protocols.
- Key length indicates the length of the generated session key. This will be 0 if no session key was requested.
Here is the Logoff event:
An account was logged off.
Subject:
Security ID: SYSTEM
Account Name: TTA-INTRANET$
Account Domain: TTACORP
Logon ID: 0x19a3650
Logon Type: 3
This event is generated when a logon session is destroyed. It may be positively correlated with a logon event using the Logon ID value. Logon IDs are only unique between reboots on the same computer.
The logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network).
The New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on.
The network fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.
The authentication information fields provide detailed information about this specific logon request.
- Logon GUID is a unique identifier that can be used to correlate this event with a KDC event.
- Transited services indicate which intermediate services have participated in this logon request.
- Package name indicates which sub-protocol was used among the NTLM protocols.
- Key length indicates the length of the generated session key. This will be 0 if no session key was requested.
Here is the Logoff event:
An account was logged off.
Subject:
Security ID: SYSTEM
Account Name: TTA-INTRANET$
Account Domain: TTACORP
Logon ID: 0x19a3650
Logon Type: 3
This event is generated when a logon session is destroyed. It may be positively correlated with a logon event using the Logon ID value. Logon IDs are only unique between reboots on the same computer.
ASKER
I think we are running out of ideas and so I guess the best thing for us to do is to close this thread. If you agree, then I thank you for your help and for sticking with me on this. I will open a new question to see if anyone else has any ideas. OK?
Your basic problem is that you need the user to be authenticated in order to be able to retrieve their identity, you need to configure your IIS server to use windows authentication, di you try the steps in the link I provided : http://technet.microsoft.c om/en-us/l ibrary/cc7 54628(WS.1 0).aspx
ASKER
I tried the steps in the link you provided and now Windows Authentication is enabled. The user name does appear when I run the app from VS 2010 on my development computer, but the user name is blank when I display the web page on my workstation using my IE8. Also, when I log into the web server and run IE8 and show the localhost, the user name is also blank. All that shows in IE is "Welcome:".
Here is the code from my Default.aspx.vb:
Imports System.DirectoryServices.A ccountMana gement
Partial Class _Default
Inherits System.Web.UI.Page
'Inherits UserPrincipal
Public mUserName As String
Public Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
'mUserName = UserPrincipal.Current.Disp layName
mUserName = System.Web.HttpContext.Cur rent.User. Identity.N ame
Catch
If Err.Number <> 0 Then
mUserName = ""
End If
End Try
End Sub
End Class
And here is the display code from my Default.aspx:
<form runat="server">
<div style="position:absolute; top:113px; left:825px; z-index: 1; visibility:visible; height: 20px; width: 300px; text-align:right;">
<p>Welcome: &nb sp;<%=mUse rName%></p >
</div>
...
I assume that having Debug="true" in the page directive at the top doesn't make any difference:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" Debug="true" %>
Here is the code from my Default.aspx.vb:
Imports System.DirectoryServices.A
Partial Class _Default
Inherits System.Web.UI.Page
'Inherits UserPrincipal
Public mUserName As String
Public Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
'mUserName = UserPrincipal.Current.Disp
mUserName = System.Web.HttpContext.Cur
Catch
If Err.Number <> 0 Then
mUserName = ""
End If
End Try
End Sub
End Class
And here is the display code from my Default.aspx:
<form runat="server">
<div style="position:absolute; top:113px; left:825px; z-index: 1; visibility:visible; height: 20px; width: 300px; text-align:right;">
<p>Welcome: &nb
</div>
...
I assume that having Debug="true" in the page directive at the top doesn't make any difference:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
ASKER
Any ideas?
Can you check your web.config and see if you have the following line in it:
<authentication mode="Windows" />
<authentication mode="Windows" />
ASKER
Yes "<authentication mode="Windows"/>" is present in the web.config file. See code attached.
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings/>
<connectionStrings/>
<system.web>
<!--
Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<compilation debug="true" strict="true" explicit="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.DirectoryServices.AccountManagement, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<pages>
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Generic"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Linq"/>
<add namespace="System.Xml.Linq"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
<runtime>
<assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
try adding this line directly after the above line, I don't really think you should need this but lets see what happens
<identity impersonate="true"/>
<identity impersonate="true"/>
ASKER
I added it and nothing changed.
I'm afraid i'm out of ideas then.
ASKER
Thank you so much for all of your help. I really appreciate your thoughts, suggestions, and willingness to hang in there.
I am going to post another question to see if anyone else has some thoughts.
I am going to post another question to see if anyone else has some thoughts.
I hope you have done IIS reset after your changes.
Do let us know the after the change what shows up in the event viewer after you do iisreset and try to hit the url again
Do let us know the after the change what shows up in the event viewer after you do iisreset and try to hit the url again
ASKER
I have not done an IIS reset. Did not know there was that option. I will try it tomorrow when I get back to work. Where would I find that option? In the Services menu where all services are listed or in the IIS window or somewhere else? Thanks
From earlier versions we can run iisreset from windows command line , I dont about version 7 , it is definitely aslo iis window short cut menus
you can also restart the service to achieve the desired results.Do check even viewer details once you access this page agin
ASKER
OK. I will restart the service, then test the web page to see if anything changes, then I'll check the Event Viewer and will let you know. Thank you
ASKER
Will need to wait until tomorrow, Monday, in order to do above.
ASKER
I did some research and found that Microsoft no longer supports restarting IIS. In fact, the option is no longer available in IIS 7 or 7.5.
See: http://technet.microsoft.com/en-us/library/dd364067%28WS.10%29.aspx
Also, all three of the IIS 7.5 authentications are Disabled in the IIS 7.5 Authentication windows. I did run a command line utility that was suppose to turn on Windows Auth but Windows Auth does not show up in the IIS 7.5 Authentication window. Why not and how can I confirm that Windows Authentication is Enabled? If Windows Authentication is not Enabled, that would explain why the user's login name is not appearing.
Thanks
See: http://technet.microsoft.com/en-us/library/dd364067%28WS.10%29.aspx
Also, all three of the IIS 7.5 authentications are Disabled in the IIS 7.5 Authentication windows. I did run a command line utility that was suppose to turn on Windows Auth but Windows Auth does not show up in the IIS 7.5 Authentication window. Why not and how can I confirm that Windows Authentication is Enabled? If Windows Authentication is not Enabled, that would explain why the user's login name is not appearing.
Thanks
ASKER
Success. The command line program does not work but following these directions does enable Windows Authentication, does cause Windows Authentication to appear in the IIS authentication window, and does now display the user's login name to appear. Finally.
See: http://www.iis.net/ConfigReference/system.webServer/security/authentication/windowsAuthentication
Thank you for all the help.
See: http://www.iis.net/ConfigReference/system.webServer/security/authentication/windowsAuthentication
Thank you for all the help.
ASKER
saranyannarayanan:
Please see this question so I can award points to you. Thanks for your help.
https://www.experts-exchange.com/questions/26868642/Points-for-saranyannarayanan.html
Please see this question so I can award points to you. Thanks for your help.
https://www.experts-exchange.com/questions/26868642/Points-for-saranyannarayanan.html
The article below should help you.
http://www.codeproject.com/KB/dotnet/UserName.aspx
It could be different in .NET 4.0