title: Tomcat AD Authentication - Allow all AD users
body: <p>How can I allow all users in the AD to login to my application (enforce that they login)? Not just defined by group. </p>
  
  <p>This is my web.xml. </p>
  
  <pre><code>&lt;security-constraint&gt;
      &lt;web-resource-collection&gt;
          &lt;web-resource-name&gt;MyApplication&lt;/web-resource-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/web-resource-collection&gt;
  
  &lt;/security-constraint&gt;
  
  &lt;security-role&gt;
    &lt;role-name&gt;some-ad-role&lt;/role-name&gt;
  &lt;/security-role&gt;
  &lt;security-role&gt;
    &lt;role-name&gt;another-ad-role&lt;/role-name&gt;
  &lt;/security-role&gt;
  
  &lt;!-- Basic Authentication using a JNDIRealm --&gt;
  &lt;login-config&gt;
      &lt;auth-method&gt;BASIC&lt;/auth-method&gt;
      &lt;realm-name&gt;Login&lt;/realm-name&gt;
  &lt;/login-config&gt;
  </code></pre>
  
  <p>I still want to use AD groups for authorization within my application using request.isUserInRole() but initially everyone can login to the application in order for me to have their username for checking purposes.</p>