Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied

I have my website. First time I can successfully login.

Default address:

www.abc.com   

I typed this on browser and I redirected to my login page:

www.abc.com/pages/landingpage.aspx

I entered my login credential and log into the site.

After some time I opened a new tab and enter my website address

www.abc.com

Now it gives me an error:

403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.

The whole story is this: if I am not logged on my site, then I can open my site number of tabs and browsers. But as soon as I logged in my site, I am getting the error above.

 <authentication mode="Forms">
  <forms name="MMFormAUTH" loginUrl="Pages/LandingPage.aspx" defaultUrl="Pages/LandingPage.aspx" timeout="60" protection="All" slidingExpiration="true" enableCrossAppRedirects="false" requireSSL="false" />
</authentication>
<authorization>
  <deny users="?" />
</authorization>
<sessionState cookieless="false" cookieName="abc" mode="InProc" timeout="60">
</sessionState>
<httpRuntime maxRequestLength="1000240" executionTimeout="120" />
like image 903
vikas Avatar asked Oct 15 '12 09:10

vikas


People also ask

How do I get rid of 403 Forbidden on Chrome?

Many times the 403 error is temporary, and a simple refresh might do the trick. Most browsers use Ctrl+R on Windows or Cmd+R on Mac to refresh, and also provide a Refresh button somewhere on the address bar. It doesn't fix the problem very often, but it takes just a second to try.

Why am I getting 403 Forbidden on a website?

The 403 Forbidden Error happens when the web page (or another resource) that you're trying to open in your web browser is a resource that you're not allowed to access. It's called a 403 error because that's the HTTP status code that the webserver uses to describe that kind of error.


2 Answers

Try this

 <allow  users="?" />

Now you are using <deny users="?" /> that means you are not allowing authenticated user to use your site.

authorization Element

like image 86
jams Avatar answered Sep 21 '22 15:09

jams


I had the same problem. It turned out that I didn't specify a default page and I didn't have any page that is named after the default page convention (default.html, defult.aspx etc). As a result, ASP.NET doesn't allow the user to browse the directory (not a problem in Visual Studio built-in web server that allows you to view the directory) and shows the error message. To fix it, I added one default page in Web.Config and it worked.

<system.webServer>
    <defaultDocument>
        <files>
            <add value="myDefault.aspx"/>
        </files>
    </defaultDocument>
</system.webServer>
like image 38
Ying Avatar answered Sep 17 '22 15:09

Ying