title: weblogic 12c basic authentication not prompting for userid
body: <p>I am trying to configure basic authentication for a servlet deployed on Weblogic 12c. Here is my web.xml</p>
  
  <pre><code>&lt;security-constraint&gt;
   &lt;web-resource-collection&gt;
       &lt;web-resource-name&gt;TestServlets&lt;/web-resource-name&gt;
       &lt;url-pattern&gt;/ReasonServlet&lt;/url-pattern&gt;
   &lt;/web-resource-collection&gt;
   &lt;auth-constraint&gt;
      &lt;role-name&gt;TestServiceRole&lt;/role-name&gt;
   &lt;/auth-constraint&gt;
  &lt;/security-constraint&gt;
  
  &lt;login-config&gt;
   &lt;auth-method&gt;BASIC&lt;/auth-method&gt;
   &lt;realm-name&gt;default&lt;/realm-name&gt;
  &lt;/login-config&gt;
  
  &lt;security-role&gt;
   &lt;role-name&gt;TestServiceRole&lt;/role-name&gt;
  &lt;/security-role&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;ReasonServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.test.go.track.servlets.ReasonServlet&lt;/servlet-class&gt;
    &lt;/servlet&gt;
  &lt;servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;ReasonServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/ReasonServlet&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;  
  </code></pre>
  
  <p> </p>
  
  <p>Here is my weblogic.xml:</p>
  
  <pre><code>&lt;security-role-assignment&gt;
    &lt;role-name&gt;TestServiceRole&lt;/role-name&gt;
    &lt;principal-name&gt;TestUsers&lt;/principal-name&gt;
  &lt;/security-role-assignment&gt; 
  </code></pre>
  
  <p>I also did the following:</p>
  
  <ol>
  <li>Created a user - test, created a group - TestUsers </li>
  <li>Added the user test to TestUsers</li>
  <li>created a role - TestServiceRole, added TestUsers group as role condition.</li>
  <li>Restarted weblogic after making these changes and application deployment. </li>
  </ol>
  
  <p>Now when I try to access my servlet via browser,  I dont get any pop-up to enter http userid/password. I am able to access the servlet as if there is no security configured. </p>
  
  <p>However, when I test my servlet via SoapUI/java client, and explicitly set some wrong http credentials (base64 encoded userid:wrongpassword) in HTTP header (Authorization: Basic ),  then weblogic rejects the request with a 401-authorization required error. </p>
  
  <p>When there is no http authorization header in the request, the access is granted. </p>
  
  <p>Is there some other configuration I am missing in weblogic? 
  I want the basic authentication check to happen always whether there is http auth header is there or not. </p>
  
  <p>Please help!! Struggling with this issue for the last 2 days.. </p>
  
  <p>Thanks!</p>