title: Difference between security-realm and security-domain in WildFly
body: <p>What is the main difference between security-domain and security-realm in WildFly?</p>
  
  <p><strong>standalone.xml</strong></p>
  
  <pre><code>               &lt;security-domain name="foo"&gt;             
                      &lt;authentication&gt;
                          &lt;login-module code="..." flag="..."&gt;                           
                          &lt;/login-module&gt;                                         
                      &lt;/authentication&gt;
                  &lt;/security-domain&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>        &lt;security-realm name="foo"&gt;
              &lt;authentication&gt;
                  &lt;local default-user="..." allowed-users="..." 
  skip-group-loading="..."/&gt;
                  &lt;properties path="..." relative-to="..."/&gt;
              &lt;/authentication&gt;
              &lt;authorization&gt;
                  &lt;properties path="..." relative-to="..."/&gt;
              &lt;/authorization&gt;
          &lt;/security-realm&gt;
  </code></pre>