title: unable to set security domain via jboss-web.xml
body: <p>We have an app that is being deployed as an ear. Within this ear, there is a war that needs to use a specific security domain.</p>
  
  <p>To achieve this, we have configured the standalone-full-ha.xml with the following security section</p>
  
  <pre><code>&lt;security-domain name="ourDomain" cache-type="default"&gt;
      &lt;authentication&gt;
          &lt;login-module code="blah.blah.OurDomain" flag="required" /&gt;
      &lt;/authentication&gt;
  &lt;/security-domain&gt;
  </code></pre>
  
  <p>ear/war/WEB-INF/jboss-web.xml is configured as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jboss-web&gt;
     &lt;security-domain&gt;Quark&lt;/security-domain&gt;
     &lt;disable-audit&gt;true&lt;/disable-audit&gt;
  &lt;/jboss-web&gt;
  </code></pre>
  
  <p>With this configuration, the app tries to authenticate against the "other" domain which is there in JBoss by default.</p>
  
  <p>log entries as follows:</p>
  
  <pre><code>TRACE [org.jboss.security] (http-/127.0.0.1:8080-6) PBOX000224: End getAppConfigurationEntry(other), AuthInfo: AppConfigurationEntry[]:
  [0]
  LoginModule Class: org.jboss.as.security.remoting.RemotingLoginModule
  ControlFlag: LoginModuleControlFlag: optional
  Options:
  name=password-stacking, value=useFirstPass
  [1]
  LoginModule Class: org.jboss.as.security.RealmDirectLoginModule
  ControlFlag: LoginModuleControlFlag: required
  Options:
  name=password-stacking, value=useFirstPass
  </code></pre>
  
  <p>When trying to define this as part of the ear in ear/META-INF/jboss-app.xml, that made the whole thing blow up pretty spectacularly - so figured that was less likely to be the way to resolve this.</p>
  
  <p>If the default security domain is changed to <code>ourDomain</code> however, it all works as expected.</p>
  
  <p>This doesn't seem to be a big deal - however, it feels better to be able to leave as much of the configuration in the app as possible.</p>
  
  <p>Any pointers to resolve this appreciated.</p>