I have tried to show the static content of a website like pdf files or images only to authenticated users using ASP.net Forms authentication and authorization rules. I put in my root config file the following configuration :
<system.web>
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="Login.aspx">
</authentication>
</system.web>
And in the folder that I have the pdf files and images a config file with the following configuration:
<configuration>
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>
It works when I am not login in the website I cannot see the files and I get redirected to the login page, but the issue is that I cannot see the files even when I log in to the website, it still redirects me like I am not logged in when I try to see the files. Can you please help me what I am doing wrong?