Good Morning,

  I'm trying to set up an authentication task using the form method
and an xml files to store the users and their roles.
Now, I've add this to the web.xml file:

==
[...]
<resource-env-ref>
    <resource-env-ref-name>PhotoUsers</resource-env-ref-name>
    
<resource-env-ref-type>org.apache.catalina.UserDatabase</resource-env-ref-type>
  </resource-env-ref>
  <security-constraint>
    <display-name>Photoalbum Security Constraints</display-name>
    <web-resource-collection>
      <web-resource-name>Photoalbum</web-resource-name>
      <url-pattern>/controlPanel.jsp</url-pattern>
      <url-pattern>/photoUpload.jsp</url-pattern>
      <url-pattern>/login.jsp</url-pattern>      
      <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>
      <role-name>photoalbum</role-name>
      <role-name>admin</role-name>
    </auth-constraint>
  </security-constraint>
  <login-config>
      <auth-method>FORM</auth-method>   
      <realm-name>PhotoUsers</realm-name>   
      <form-login-config>
        <form-login-page>/login.jsp</form-login-page>
        <form-error-page>/error.jsp</form-error-page>        
      </form-login-config>
    </login-config>
  <security-role>
    <role-name>photoalbum</role-name>
  </security-role>
  <security-role>
    <role-name>admin</role-name>
  </security-role>
[...]
==

then I've added the following lines to the between the context tag of
the webapplication:

==
<?xml version="1.0" encoding="utf-8"?>
<Context path="" displayName="photoalbum" docBase="." relodable="true"
privileged="true">
  <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs/photoalbum/" fileDateFormat="yyyy-MM-dd"
prefix="photoalbum_access_log." suffix=".txt"/>
  <GlobalNamingResources>
    <Environment value="30" type="java.lang.Integer" name="simpleValue"/>
    <Resource type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
auth="Container" name="PhotoUsers"/>
    <ResourceParams name="PhotoUsers">
      <parameter>
        <name>factory</name>
        <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
      </parameter>
      <parameter>
        <name>pathname</name>
        <value>/photoalbum-users.xml</value>
      </parameter>
    </ResourceParams>
  </GlobalNamingResources>
  <ResourceLink name="users" global="PhotoUsers"
type="org.apache.catalina.UserDatabase"/>
</Context>
==

and I have putted the file photoalbum-users.xml in the same folder as
the previous file.

Now, this seems to not work... does' anyone can help me?

Omar

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to