title: WebLogic simple realm (like tomcat-users.xml)
body: <p>Like <a href="https://stackoverflow.com/questions/2668698/websphere-7-simple-realm-like-tomcat-users-xml">this fellow here</a>, I'm trying to port a Tomcat application to WebLogic.</p>
  
  <p>I have a few resources protected by security rules in web.xml. Instead of BASIC, I'm using FORM authentication, but that should be irrelevant.</p>
  
  <p>In Tomcat, it's very easy to set up a simple security realm, by editing <code>conf/tomcat-users.xml</code>.</p>
  
  <p>How do I set up a simple security realm in Weblogic ? All I want is to have the user to input his username and password and have it authenticated by the container.</p>
  
  <pre><code>&lt;security-constraint&gt;
      &lt;web-resource-collection&gt;
          &lt;web-resource-name&gt;basic-auth security&lt;/web-resource-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/web-resource-collection&gt;
      &lt;auth-constraint&gt;
          &lt;role-name&gt;HELLO_USER&lt;/role-name&gt;
      &lt;/auth-constraint&gt;
      &lt;user-data-constraint&gt;NONE&lt;/user-data-constraint&gt;
  &lt;/security-constraint&gt;
  &lt;login-config&gt;
      &lt;auth-method&gt;FORM&lt;/auth-method&gt;
      &lt;realm-name&gt;somerealm&lt;/realm-name&gt;
      &lt;form-login-config&gt;
          &lt;form-login-page&gt;login.jsp&lt;/form-login-page&gt;
          &lt;form-error-page&gt;error.jsp&lt;/form-error-page&gt;
      &lt;/form-login-config&gt;
  &lt;/login-config&gt;
  &lt;security-role&gt;
      &lt;role-name&gt;HELLO_USER&lt;/role-name&gt;
  &lt;/security-role&gt;
  </code></pre>