Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-12-01
8
Medium Priority
?
3,836 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

661 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