Securing a Static Folder

Vote:
 

Is there a way to secure a Static Folder so that attempting access files under the folder triggers a EpiServer login in order to view them? 

#228587
Sep 30, 2020 11:48
Vote:
 

Untested, but this probably works

<location path="modulesbin">
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
</location>

  <location path="your-folder">
    <system.web>
      <authorization>
        <deny users="*" />
        <allow roles="WebEditors, WebAdmins, Administrators" />
      </authorization>
    </system.web>
    <system.webServer>
      <handlers>
        <clear />
        <add name="wildcard" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer.Framework.AspNet" />
      </handlers>
    </system.webServer>
  </location>
#228590
Sep 30, 2020 15:39
Vote:
 

Perfect, thanks!

#228595
Sep 30, 2020 18:44
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.