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" />
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.
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.
Try this
<allow users="?" />
Now you are using <deny users="?" />
that means you are not allowing authenticated user to use your site.
authorization Element
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With