2 Replies Latest reply on May 13, 2014 7:13 AM by Travis De Silva

    Protecting Static Content

    Travis De Silva Newbie



      Has anybody used Wildfly/undertow to provide access to static folders for only authorised users?


      My use case is that I have web content that I would like to service via Wildfly for only authorised users. Following is what I was able to get it.


      In the standalone.xml file, I added the following config.


      <server name="default-server">
      <http-listener name="default" socket-binding="http"/>
      <host name="default-host" alias="localhost">
        <location name="/" handler="welcome-content"/>
        <location name="/img" handler="images">
        <filter-ref name="my-auth"/>
        <basic-auth name="my-auth" security-domain="other"/>
        <file name="welcome-content" path="${jboss.home.dir}/welcome-content" directory-listing="true"/>
        <file name="images" path="/var/images" directory-listing="true"/>


      Note that I have my security-domain configured under the security domains subsystem config section.


      The problem I am having is when I start Wildfly, I get the following error.

      Caused by: java.lang.RuntimeException: JBAS017346: Could not construct handler for class: class io.undertow.security.handlers.AuthenticationCallHandler. with parameters {"security-domain" => "other"}


      Can anyone let me know what I maybe doing wrong here.