tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Omar Adobati <omar.adob...@gmail.com>
Subject Basic Auth Errors
Date Thu, 10 Feb 2005 17:32:41 GMT
Good Morning,
  I'm here again with a trouble that I had already submitted but that
isn't yet solved.
Here is the topic:

I'm trying to setup a basic authentication using realm. 
I'm working on a Linux Machine with Tomcat 5.0.28 and JDK 1.4.2 (last
stable before Tiger).

Then, I've set up the server XML in this way:
==
<Host appBase="webapps/photoalbum" name="photoalbum.localhost">
        <Logger className="org.apache.catalina.logger.FileLogger"
directory="logs/photoalbum/" suffix=".txt" prefix="photoalbum_log."
timestamp="true"/>
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="PhotoAlbum"/>
      </Host>
==

the context.xml file (that is stored into
TOMCAT_HOME/conf/Catalina/photoalbum.localhost) I've putted this code:
===
<?xml version='1.0' encoding='utf-8'?>
<Context privileged="true" swallowOutput="true"
workDir="work\Catalina\photoalbum\" path="/" cacheTTL="0"
cachingAllowed="false" displayName="bannerEmbedded beta" docBase="."
cacheMaxSize="0" reloadable="true" privileged="true">
  <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="PhotoAlbum"/>
  <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs/photoalbum/" fileDateFormat="yyyy-MM-dd" suffix=".txt"
prefix="photoalbum_access_log."/>
   <Resource type="org.apache.catalina.UserDatabase" description="User
database that can be updated and saved" auth="Container"
name="PhotoAlbum"/>
    <ResourceParams name="PhotoAlbum">
      <parameter>
        <name>factory</name>
        <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
      </parameter>
      <parameter>
        <name>pathname</name>
        <value>conf/Catalina/photoalbum.localhost/photoalbum-users.xml</value>
      </parameter>
    </ResourceParams>  

</Context>
===

then I've setting up the web.xml as usual to this kind of uses:
===
<resource-env-ref>
    <description>Link to the UserDatabase instance from which we
request lists of
      defined role names.  Typically, this will be connected to the global
      user database with a ResourceLink element in server.xml or the context
      configuration file for the Manager web application.</description>
    <resource-env-ref-name>PhotoAlbum</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>PhotoAlbum</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>
===

In the log i read thsi errors with their relative stack trace (will be omitted)
a) javax.naming.NameNotFoundException: Name PhotoAlbum is not bound in
this Context
b) LifecycleException:  No UserDatabase component found under key PhotoAlbum

so, this configuration would not work.
Can anyone help me?

-- 
Adobati Omar
Italy

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message