Skip to content
mchyzer edited this page Jun 4, 2013 · 3 revisions

Download the source.

Create a DB schema in Oracle, MySQL, or Postgres.

Configure the twoFactor.hibernate.properties with the DB URL, user/pass

Edit the web.xml, and uncomment the container authorization section at the bottom.

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Web services</web-resource-name>
      <url-pattern>/twoFactorUi/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>tf_user</role-name>
    </auth-constraint>
  </security-constraint>

  <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>Two Factor</realm-name>
  </login-config>

  <security-role>
    <description>
      The role that is required to log in to web service
    </description>
    <role-name>tf_user</role-name>
  </security-role>

Add some users in the tomcat-users.xml

  <role rolename="tf_user"/>
  <user username="abc" roles="tf_user" password="pass"/>
  <user username="abd" roles="tf_user" password="pass"/>
  <user username="abe" roles="tf_user" password="pass"/>
  <user username="abf" roles="tf_user" password="pass"/>
  <user username="abg" roles="tf_user" password="pass"/>

Run an ant build

Clone this wiki locally