Hi!

What does "Now, this seems to not work..." mean???
Please go more into detai! We cannot tell you how to fix it if you do not tell us WHAT is going wrong! (e.g.: Tomcat can't start; Tomcat starts but web-app. can't start; Tomcat starts, webapp starts but you get exceptions each time you request your web-app; Everything fine but the specified resource is not secured; Everything fine and the specified resource is secured but even when I enter the correct username/password I can't access it; ...).


Best regards,
 Tex

Omar Adobati wrote:

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]







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



Reply via email to