title: Using 2authorization realm in Wildfly Elytron Security
body: <p>I want to user an authentication realm trough ldap. This works fine.
  Secondly i want store UserRoles for my application in a Roles tables, this works also fine. (Example below, with an aggregate-realm)</p>
  <p>But i dont know how to obtain both roles. Roles from LDAP and from my Roles table together.</p>
  <p>What i am missing?</p>
  <pre><code>         &lt;security-domain name=&quot;securtiyDomain&quot; default-realm=&quot;my-realm&quot; permission-mapper=&quot;default-permission-mapper&quot;&gt;
                  &lt;realm name=jdbc-realm&quot;   role-decoder=&quot;from-roles-attribute&quot;/&gt;
              &lt;/security-domain&gt;
     
          &lt;security-realms&gt;
              &lt;aggregate-realm name=&quot;my-realm&quot; authentication-realm=&quot;ldap-realm&quot; authorization-realms=&quot;jdbc-realm ldap-realm&quot;/&gt;
  
              &lt;jdbc-realm name=&quot;jdbc-realm&quot;&gt;
                  &lt;principal-query .... &gt;
                      &lt;attribute-mapping&gt;
                          &lt;attribute to=&quot;roles&quot; index=&quot;1&quot;/&gt;
                      &lt;/attribute-mapping&gt;
                  &lt;/principal-query&gt;
              &lt;/jdbc-realm&gt;
  
              &lt;ldap-realm name=&quot;ldap-realm&quot; dir-context=&quot;ldap-connection&quot; direct-verification=&quot;true&quot;&gt;
                  &lt;identity-mapping ...&gt;
                      &lt;attribute-mapping&gt;
                          &lt;attribute from=&quot;cn&quot; to=&quot;Roles&quot; .../&gt;
                      &lt;/attribute-mapping&gt;
                      &lt;user-password-mapper from=&quot;userPassword&quot;/&gt;
                  &lt;/identity-mapping&gt;
              &lt;/ldap-realm&gt;
  
              &lt;simple-role-decoder name=&quot;from-roles-attribute&quot; attribute=&quot;roles&quot;/&gt;
  </code></pre>