Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

HTTP 401.1 - Unauthorized: Logon Failed - ASP.NET IIS problem

Posted on 2006-12-01
8
Medium Priority
?
3,840 Views
Last Modified: 2008-01-09
Hi  Experts

Developing ASP.NET 2.0 app that works fine at work and did work fine when I copied it to my home PC.  

But now it still works fine at work but when I copied the files back on my home PC and run the app I get a login screen which I don't get at my work PC.  Then I get the errror "HTTP 401.1 - Unauthorized: Logon Failed"  any advice appreciated.


0
Comment
Question by:mugsey
  • 5
  • 3
8 Comments
 
LVL 11

Expert Comment

by:ethoths
ID: 18053595
Looks like it's using Windows authentication and since your authenticated at your work machine (on your network) it passing. Send your Web.Config file.

0
 

Author Comment

by:mugsey
ID: 18053605
Thanks ethoths

Here is my web.config...................

<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
      <configSections>
            <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>
            <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      </configSections>
      <loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">
            <listeners>
                  <add fileName="DSItrace.log" header="DSI Logging ---------------------------------------- DSI Logging" footer="DSI Logging ---------------------------------------- DSI Logging" formatter="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="FlatFile TraceListener"/>
            </listeners>
            <formatters>
                  <add template="Timestamp: {timestamp}
Message: {message}
Category: {category}
Priority: {priority}
EventId: {eventid}
Severity: {severity}
Title:{title}
Machine: {machine}
Application Domain: {appDomain}
Process Id: {processId}
Process Name: {processName}
Win32 Thread Id: {win32ThreadId}
Thread Name: {threadName}
Extended Properties: {dictionary({key} - {value}
)}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Text Formatter"/>
            </formatters>
            <categorySources>
                  <add switchValue="All" name="General">
                        <listeners>
                              <add name="FlatFile TraceListener"/>
                        </listeners>
                  </add>
            </categorySources>
            <specialSources>
                  <allEvents switchValue="All" name="All Events"/>
                  <notProcessed switchValue="All" name="Unprocessed Category"/>
                  <errors switchValue="All" name="Logging Errors &amp; Warnings">
                        <listeners>
                              <add name="FlatFile TraceListener"/>
                        </listeners>
                  </errors>
            </specialSources>
      </loggingConfiguration>
      <exceptionHandling>
            <exceptionPolicies>
                  <add name="DSILog">
                        <exceptionTypes>
                              <add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow" name="Exception">
                                    <exceptionHandlers>
                                          <add logCategory="General" eventId="100" severity="Error" title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" priority="0" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Logging Handler"/>
                                    </exceptionHandlers>
                              </add>
                        </exceptionTypes>
                  </add>
            </exceptionPolicies>
      </exceptionHandling>
      <appSettings>
            <add key="NominatedEmail" value="eugene.cook@liverpooldirectlimited.co.uk"/>
            <add key="FromEmail" value="eugene.cook@liverpooldirectlimited.co.uk"/>
      </appSettings>
      <!-- email settings -->
      <system.net>
            <mailSettings>
                  <smtp>
                        <network host="itsnt440.liverpool.gov.uk"/>
                  </smtp>
            </mailSettings>
      </system.net>
      <system.web>
            <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
            <compilation debug="true">
                  <assemblies>
                        <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                        <add assembly="System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                        <add assembly="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                        <add assembly="System.Windows.Forms, Version=2.0.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"/>
            <authorization>
                  <deny users="?"/>
            </authorization>
            <!--
            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="On" defaultRedirect="_webForms/GenericError.aspx">
                  <error statusCode="403" redirect="NoAccess.htm"/>
                  <error statusCode="404" redirect="FileNotFound.htm"/>
            </customErrors>
            <pages theme="DSI"/>
            <!-- get the current user-->
            <profile>
                  <properties>
                        <add name="UserName"/>
                  </properties>
            </profile>
      </system.web>
</configuration>
0
 

Author Comment

by:mugsey
ID: 18053730
If I navigate to localhost I still get the same login prompt
0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
LVL 11

Accepted Solution

by:
ethoths earned 2000 total points
ID: 18053774
This is  your problem...

 <authentication mode="Windows"/>
          <authorization>
               <deny users="?"/>
          </authorization>

Basically thi si ssaying deny access to anybody who is not Windows authenticated.

What are the security requirements for your site?



0
 

Author Comment

by:mugsey
ID: 18053792
But even if I set authenticatio mode to "None" I still get the login prompt.  I can run other asp.net apps fine its just this one.  Even if I navigate to http://localhost/ I still get the login prompt.  

I will be using my own security via a database table but I also need to trap users logged in NT username.
0
 
LVL 11

Expert Comment

by:ethoths
ID: 18053811
Check you anomynous access setting in IIS.

0
 

Author Comment

by:mugsey
ID: 18053821
Yep I have done this also - really strange.
0
 

Author Comment

by:mugsey
ID: 18053879
Dohhh!

You were right ethos - I removed the deny users section and it works fine

<authentication mode="Windows"/>
            <!--<authorization>
                  <deny users="?"/>
            </authorization> -->

Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to count occurrences of each item in an array.

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question