On 04/04/2011 06:09, Andrew Kolchoogin wrote:
> Nothing helps: all Google search results refers me either to
> UserDatabase Realm and conf/tomcat-users.xml (that is obviously works
> well -- I've tested it) or to realm authentication for THIRD-PARTY
> applications, that I'm not interested in.

>     <Resource name="jdbc/auth" auth="Container"
>               type="javax.sql.DataSource"
>               driverClassName="com.mysql.jdbc.Driver"
>               url="jdbc:mysql://host.domain.tld/database_name"
>               username="db_username"
>               password="db_password"
>               maxActive="8"
>               maxIdle="4" />

That looks OK.

>       <Realm className="org.apache.catalina.realm.LockOutRealm">
>         <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>              resourceName="UserDatabase" />
>         <Realm className="org.apache.catalina.realm.DataSourceRealm"
>                dataSourceName="jdbc/auth"
>                userTable="users" userNameCol="user" userCredCol="password"
>                userRoleTable="roles" roleNameCol="role" />
>       </Realm>

This also looks OK, altough if you aren't interested in using the
UserDatabaseRealm, why is it still configured?

> Once more: there're no log errors and even there're no log _warnings_
> after Tomcat is started by me and I'm making an attempt to use Tomcat
> Manager. Tomcat gives me HTTP Basic Authentication window in my Web
> browser, I'm entering login and password in it, and authentication
> fails. No log errors/warnings given. Not even in a case I have removed
> (!) mysql-connector-java.jar.
> 
> So, what am I doing wrong?

Telling us which Tomcat 7 version you are using would be a start,
although I'm not aware of any issues with any of them.

You won't see any error messages from DataSourceRealm until you try and
use it and it fails.

Enabling debug logging for org.apache.catalina.realm should show you
what is going on.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to