title: JBoss AS6 Realm configuration
body: <p>I'm configuring JBoss AS6 with <a href="http://www.jasig.org/cas" rel="nofollow">Jasig CAS SSO authority</a> and JAAS. By <a href="https://wiki.jasig.org/display/CASC/JAAS+Integration" rel="nofollow">wiki tutorial</a> of JBoss CAS and JAAS configuration I've changed <code>/opt/jboss-6.0.0.Final/server/all/conf/login-config.xml</code> accordingly</p>
  
  <pre><code>&lt;application-policy name="myRealm"&gt;
     &lt;authentication&gt;
        &lt;login-module code="org.jasig.cas.client.jaas.CasLoginModule" flag="required"&gt;
           &lt;module-option name="ticketValidatorClass"&gt;org.jasig.cas.client.validation.Cas10TicketValidationFilter&lt;/module-option&gt;
           &lt;module-option name="casServerUrlPrefix"&gt;https://cas.domain.com:8443/&lt;/module-option&gt;
           &lt;module-option name="defaultRoles"&gt;MYROLE&lt;/module-option&gt;
           &lt;module-option name="roleAttributeNames"&gt;memberOf,eduPersonAffiliation,authorities&lt;/module-option&gt;
           &lt;module-option name="principalGroupName"&gt;CallerPrincipal&lt;/module-option&gt;
           &lt;module-option name="roleGroupName"&gt;Roles&lt;/module-option&gt;
           &lt;module-option name="cacheAssertions"&gt;true&lt;/module-option&gt;
           &lt;module-option name="cacheTimeout"&gt;480&lt;/module-option&gt;
           &lt;module-option name="cacheAssertions"&gt;true&lt;/module-option&gt;
        &lt;/login-module&gt;
     &lt;/authentication&gt;
  &lt;/application-policy&gt; 
  </code></pre>
  
  <p>I've also changed <code>jboss-web.xml</code></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jboss-web&gt;
    &lt;security-domain&gt;java:/jaas/myRealm&lt;/security-domain&gt;
    &lt;context-root/&gt;
  &lt;/jboss-web&gt;
  </code></pre>
  
  <p>By remote debugging the app I've found that it falls to <code>JBossWebRealm</code> instead of <code>org.jasig.cas.client.jaas.CasLoginModule</code> class, so it looks like that I forgot some configuration. </p>
  
  <p><strong>My goal is to authorize and authenticate user by CAS SSO authority and use JAAS inside the web app.</strong></p>