File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
REST with Spring (video course)
this week in the
can't login with correct username and password
Joined: Jul 14, 2011
Sep 22, 2011 13:16:50
i'm building a webapp with a protected area i've defined a security constraint in web.xml and use a datasource realm which i defined in context.xml
below you'll find excerpts from the code in both web.xml and context.xml
can anyone see if there's something wrong?
thanks a lot
<Contex path="/FileUploadPoC"> <Resource name="jdbc/fileupload" auth="Container" maxActive="100" maxIdle="30" maxWait="10000" username="root" password=" " driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/fileupload" logAbandoned="true" removeAbandoned="true" removeAbandonedTimeout="60" type="javax.sql.DataSource" /> <Realm className="org.apache.catalina.realm.DataSourceRealm" debug="99" dataSourceName="jdbc/fileupload" localDataSource="true" userTable="userpass" userNameCol="username" userCredCol="pass" userRoleTable="userrole" roleNameCol="role" /> </Contex>
<login-config> <auth-method>BASIC</auth-method> <realm-name>Please login to acces the fileuploader</realm-name> </login-config> <security-role> <description>Sales dept.</description> <role-name>sales</role-name> </security-role> <security-constraint> <web-resource-collection> <web-resource-name>Protected Area</web-resource-name> <url-pattern>/JSP/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>sales</role-name> </auth-constraint> </security-constraint>
Joined: Oct 14, 2005
Sep 22, 2011 13:28:27
I'm not especially familiar with those files, but is the main element of the first one really supposed to be named "Contex" and not "Context"?
Joined: Jul 14, 2011
Sep 22, 2011 14:31:59
oh god i feel stupid right now
but thank you for pointing it out
so this one's for you
I agree. Here's the link:
subject: can't login with correct username and password
Cannot Connect to database using datasource realm
Tomcat BASIC Authentication Problem.
web.xml security constraint won't work with roles
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015