Allow unauthenticated access to certain file types in ASP.NET web.config, regardless of their location

Viewed 38

We deny unauthenticated access by default with:

<authorization>
  <deny users="?"/>
</authorization>

Then allow certain locations like:

<location path="login.aspx">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>

But we actually need to allow access to all CSS files, regardless of where they are (for Auryc session replays).

I know I could allow them like this:

<location path="folder/whatever.css">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>

But the problem is they are scattered all over the place, not contained in one folder.

Is there an easy way to allow all requests of a certain file type (like .css)? Or am I stuck having to add and maintain a separate entry for each individual file?

0 Answers
Related