locked
'You are not authorized to view this page' Error when trying to access web application RRS feed

  • Question

  • User-1703180741 posted

    I recently created a web application using VS 2010, compiled on .NET Framework 4.0, on a Windows 7 PC, and successfully ran the debugger and verified that it does what it's supposed to do.

    Then, I deployed it to a web server that uses IIS 6.0, and runs on Windows 2003. It also has .NET Framerwork versions 2, 3, and 4 installed.

    I verified that it works just fine from the web server in an IE 8 browser window.

    The problem I'm having is that the application doesn't run from a client PC...when I type the URL and hit 'Enter', I'm prompted for my userID and password.  After typing in the information, it prompts for my password 2 more times and then it displays the following error message:

    'You are not authorized to view this page'.

    You do not have permission to view this directory or page using the credentials that you supplied.


    Please try the following:

    • Contact the Web site administrator if you believe you should be able to view this directory or page.
    • Click the Refresh button to try again with different credentials.

    HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.
    Internet Information Services (IIS)

    I've tried compiling the application using .NET Framework 2.0, I've also added some lines to the web.config file, I've tried changing the application pool that it uses, and have also tried changing the 'logon' account to see if that would help any, but it hasn't.

    I'm hoping someone out there can help resolve this issue as it's been frustrating not knowing how to correct this type of error.

    Lots of hours researching online and asking other IT professionals has been exhausting.

    So here I am on the forum seeking guidance and resolution.

    Thanks in advance for your help and assistance!

    Wednesday, February 8, 2012 4:17 PM

Answers

  • User197322208 posted

    please verify the credentials of the folder where you have deployed.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 8, 2012 6:57 PM
  • User-1703180741 posted

    I was able to verify the credentials and during the process, I discovered that the code used to pull the information from Active Directory was incorrect.  VS 2010 didn't diaplay any kind of warning or error about a variable that I had converted to a 'string' data type.  Once I removed the 'convert to Str' function from the WindowsPrincipal variable, the error message was no longer appearing and my project ran just fine from a client PC.

    I appreciate the help and feedback and will be sure to always always always check the code even when VS 2010 doesn't display an error or warning.

    Thanks!

    "no longer frustrated"

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 16, 2012 3:50 PM

All replies

  • User-1360095595 posted
    Do you have any sort of security or access control implemented for this website?
    Wednesday, February 8, 2012 4:27 PM
  • User197322208 posted

    please verify the credentials of the folder where you have deployed.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 8, 2012 6:57 PM
  • User-1703180741 posted

    I was able to verify the credentials and during the process, I discovered that the code used to pull the information from Active Directory was incorrect.  VS 2010 didn't diaplay any kind of warning or error about a variable that I had converted to a 'string' data type.  Once I removed the 'convert to Str' function from the WindowsPrincipal variable, the error message was no longer appearing and my project ran just fine from a client PC.

    I appreciate the help and feedback and will be sure to always always always check the code even when VS 2010 doesn't display an error or warning.

    Thanks!

    "no longer frustrated"

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 16, 2012 3:50 PM