tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francesco Viscomi" <fvisc...@gmail.com>
Subject FW: configuring realm UserDatabase do not works
Date Mon, 12 Aug 2013 23:01:22 GMT
Some one can help me please!

Thanks anyway

Francesco

Italy

 

 

From: Francesco Viscomi [mailto:fviscomi@gmail.com] 
Sent: martedì 13 agosto 2013 0.54
To: 'users-owner@tomcat.apache.org'
Subject: configuring realm UserDatabase do not works

 

Hi all,

I’ve spent a lot of time to configure tomcat on using realm UserDatabase
(that is tomcat-users.xml) without success.

When I try to access the protect resource I get:

 

HTTP Status 403 - Access to the requested resource has been denied

type Status report

message Access to the requested resource has been denied

description Access to the specified resource (Access to the requested
resource has been denied) has been forbidden.

 

Apache Tomcat/7.0.27

 

 

I’m using netbeans 7.3 with this characteristic:

 

Product Version: NetBeans IDE 7.3 (Build 201306052037) 

Java: 1.6.0_25; Java HotSpot(TM) Client VM 20.0-b11 

Runtime: Java(TM) SE Runtime Environment 1.6.0_25-b06 

System: Windows XP version 5.1 running on x86; Cp1252; it_IT (nb) 

User directory: C:\Documents and Settings\francesco\Dati
applicazioni\NetBeans\7.3 

Cache directory: C:\Documents and Settings\francesco\Impostazioni
locali\Dati applicazioni\NetBeans\Cache\7.3 

 

 

I also tried on both tomcat 7.0.27.0 and tomcat 7.0.34.0.

 

These are the step I did:

1)  Adding the following statement to the the tomcat-user.xml:

====================================================================

<role rolename="UserRole"/>

<user username="user" password="uuu" role="UserRole"/>

====================================================================

 

2) take sure that on the server.xml the following statement are present:

 

====================================================================

<GlobalNamingResources>

<Resource name="UserDatabase" auth="Container"

  type="org.apache.catalina.UserDatabase"

  description="User database that can be updated and saved"

  factory="org.apache.catalina.users.MemoryUserDatabaseFactory"

  pathname="conf/tomcat-users.xml" />

</GlobalNamingResources>

====================================================================

 

====================================================================

<Realm className="org.apache.catalina.realm.LockOutRealm">

<Realm className="org.apache.catalina.realm.UserDatabaseRealm"

  resourceName="UserDatabase"/>

</Realm>

====================================================================

 

3)Configuring web.xml (inside the WEB-INF directory) as following:

 

====================================================================

<?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<session-config>

<session-timeout>

30

</session-timeout>

</session-config>

<welcome-file-list>

<welcome-file>index.jsp</welcome-file>

</welcome-file-list>

<security-constraint>

<display-name>VincoloUtente</display-name>

<web-resource-collection>

<web-resource-name>area protetta</web-resource-name>

<description/>

<url-pattern>/CartellaProtetta/*</url-pattern>

</web-resource-collection>

<auth-constraint>

<description/>

<role-name>UserRole</role-name>

</auth-constraint>

</security-constraint>

<login-config>

<auth-method>FORM</auth-method>

<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>

<description>Utenti che hanno questo ruolo (user) possono accedere all'area
protetta</description>

<role-name>UserRole</role-name>

</security-role>

</web-app>

====================================================================

 

 

4) creating the file index.jsp,login.jsp and error.jsp.

 

5)creating the path and file at “web
pages/CartellaProtetta/fileProtetto.html”

 

 

Is this a bug on tomcat or I’m making some mistake?

 

Thanks really much

Francesco

Italy

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message