locked
Logon failure: unknown user name or bad password. RRS feed

  • Question

  • User1087595689 posted

    Hi,

    I am trying to save a file using  network path, the servers are on a domain and the IUSR is shared through an active directory.

    I spent a lot of time on sharing and permissions and It finally works but then every few minutes (randomly no patterns even after checking the logs)  I get "Logon failure: unknown user name or bad password."

    both are server 2003, ASP.NET 2.0

     My code is something like this:
    Dim enc As Encoding = Encoding.UTF8
    Dim objXMLTW As New XmlTextWriter("\\Server2\wwwroot\SiteRoot\rss.xml", enc)
    objXMLTW.WriteStartDocument()
    objXMLTW.WriteStartElement("rss")
    objXMLTW.WriteElementString("Blah", "Blah Blah Blah")
    objXMLTW.WriteEndDocument()
    objXMLTW.Flush()
    objXMLTW.Close()

     web.config has:

             <identity impersonate="true" />
            <authentication mode="Windows" />
     

    Any Ideas? This is probably the most annoying thing I ever seen please help.

     


     

    Sunday, April 27, 2008 1:28 AM

Answers

  • User-1831161647 posted

    anytime i get permission errors I use filemon

    technet.microsoft.com/en-us/sysinternals/bb896642.aspx

    it was a sysinternals tool not it is under technet and microsoft

    it will tell you where the folder is faulting, what user and the reason....

    great tool

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, April 27, 2008 8:47 AM
  • User-2017008401 posted

    Hi pxpilot,

    From your description, I understand that the “Logon failure” issue occurs randomly every several minutes. Based on my experience, this can be caused by the low privilege client account. If you want to find the root cause of the that error, you probably need to use debug tool to analyze the executed codes. It is not a easy job. You can refer to the following link if you interest in. Although the sample is troubleshoot SMTP login issue, the logical for troubleshooting is the same.

    Unknown username or bad password - InetInfo.exe – ADVAPI
    http://blogs.msdn.com/puneetgupta/archive/2007/08/20/unknown-username-or-bad-password-inetinfo-exe-advapi.aspx

    Based on my experience, this issue can be solved by explicitly set the impersonation user in web.config. For example:

        <identity impersonate="true" userName="domain\user" password="password" />

    In addition, if you think impersonate a domain user for all clients’ operations is insecure, you can impersonate only for the saving file operation in code. For more information about this scenario, please refer to the following link:

    How to implement impersonation in an ASP.NET application
    http://support.microsoft.com/kb/306158

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 1, 2008 10:49 PM

All replies

  • User-1831161647 posted

    anytime i get permission errors I use filemon

    technet.microsoft.com/en-us/sysinternals/bb896642.aspx

    it was a sysinternals tool not it is under technet and microsoft

    it will tell you where the folder is faulting, what user and the reason....

    great tool

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, April 27, 2008 8:47 AM
  • User1087595689 posted

     Thanks for the quick replay, I have tested with filemon (it's a great tool) but could not see anything about the failed process, when it works I see it logging.

    It's almost like it fails to even get there.

    Sunday, April 27, 2008 11:03 AM
  • User-2017008401 posted

    Hi pxpilot,

    From your description, I understand that the “Logon failure” issue occurs randomly every several minutes. Based on my experience, this can be caused by the low privilege client account. If you want to find the root cause of the that error, you probably need to use debug tool to analyze the executed codes. It is not a easy job. You can refer to the following link if you interest in. Although the sample is troubleshoot SMTP login issue, the logical for troubleshooting is the same.

    Unknown username or bad password - InetInfo.exe – ADVAPI
    http://blogs.msdn.com/puneetgupta/archive/2007/08/20/unknown-username-or-bad-password-inetinfo-exe-advapi.aspx

    Based on my experience, this issue can be solved by explicitly set the impersonation user in web.config. For example:

        <identity impersonate="true" userName="domain\user" password="password" />

    In addition, if you think impersonate a domain user for all clients’ operations is insecure, you can impersonate only for the saving file operation in code. For more information about this scenario, please refer to the following link:

    How to implement impersonation in an ASP.NET application
    http://support.microsoft.com/kb/306158

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 1, 2008 10:49 PM
  • User47344791 posted

    <identity impersonate="true" userName="domain\user" password="password" />
     

     

    You are really Rocking  benson

     

     

    Thursday, June 12, 2008 8:37 AM
  • User-433629415 posted

    Hello Benson,

     

    I am having the same problem that everyone in this forum has. Once I run my application this is the errror message I get:

     

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: Could not create Windows user token from the credentials specified in the config file. Error from the operating system 'Logon failure: unknown user name or bad password.
    '

    Source Error:

    Line 62: 
    Line 63: 
    Line 64:     <identity impersonate="true" userName="domain\user" password="password" />
    Line 65:         <authentication mode="Windows" />
    Line 66: 

     

    Could you please help me with some advice.

     Thank you for your time

    Estera

    Tuesday, February 10, 2009 11:29 AM
  • User1155589364 posted

    Estera,

    Did you replace userName="domain\user" password="password" with your actual account info?

    eg.  userName="Mydomain\estera" password="estera-secret-password".

    Benson, thanks for your help.  In my case, accessing my XML file through the UNC syntax on a network share would work at times, but then for the next few minutes (5? 10?) it would fail as noted by OP, above.  Using your suggestion of explicitly setting the user impersonation, it never fails intermittently anymore. Thanks.

    Tuesday, November 10, 2009 10:19 AM
  • User-1474096950 posted

    i get the above error when i am trying to copy a file on a network from my asp.net webserver

    in my webconfig file i have

    <identity impersonate="true" userName="myloginname" password="mypassword"/>

    but still i get the above error

     

     

    Wednesday, February 2, 2011 5:54 AM