Friday, January 23, 2015

openshift tomcat7 realm

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"

<web-app>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Entire Application</web-resource-name>
            <url-pattern>/protected/*</url-pattern>
        <!-- If you list http methods, only those methods are protected -->
<http-method>DELETE</http-method>
         <http-method>GET</http-method>
         <http-method>POST</http-method>
<http-method>PUT</http-method>
      </web-resource-collection>
      <auth-constraint>
         <!-- Anyone with one of the listed roles may access this area -->
<role-name>ROLENAME</role-name>
         <role-name>Administrator</role-name>
         <role-name>Power User</role-name>
         <role-name>User</role-name>
         <role-name>View Only</role-name>
      </auth-constraint>
    </security-constraint>

    <login-config>
        <auth-method>FORM</auth-method>
        <realm-name>My Password-Protected Web Application</realm-name>
        <login-config>
            <form-login-page>/loginForm.jsp</form-login-page>
            <form-error-page>/loginError.jsp</form-error-page>
        </login-config>
    </login-config>


<error-page>
  <exception-type>javax.servlet.ServletException</exception-type>
  <location>/error.htm</location>
</error-page>
<error-page>
  <error-code>500</error-code>
  <location>/test.jsp</location>
</error-page>


</web-app>



<Realm className="org.apache.catalina.realm.JDBCRealm"
        connectionURL="jdbc:mysql://localhost/stealth6_stealthtrader?user=stealth6&amp;password=gbury26"
        driverName="com.mysql.jdbc.Driver"
        roleNameCol="role_name"
        userCredCol="user_pass"
        userNameCol="user_name"
        userRoleTable="user_roles"
        userTable="users"/>


No comments:

Post a Comment