You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tokajac <im...@hotmail.com> on 2008/09/19 01:12:18 UTC
j_security_check Tomcat user status
Hello!
For Connection on database i initialize in context.xml:
[CODE]
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="0"
driverName="com.Driver"
connectionURL="jdbc:url"
connectionName="CONNAME" connectionPassword="CONPASS" userTable="BFWBBUSR"
userNameCol="LOGINNM" userCredCol="USRPASS"
userRoleTable="BFWBBUSR"
roleNameCol="ROLEID"/>
[/CODE]
j_security_check works fine.
Now, i want to check another column on login: userstatus. Value of the
column can be 0 or 1. Only users with correct username and status 1 can
login.
How can i do this with j_security_check?
Regards
--
View this message in context: http://www.nabble.com/j_security_check-Tomcat-user-status-tp19563429p19563429.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: j_security_check Tomcat user status
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Tokajac,
Tokajac wrote:
> Now, i want to check another column on login: userstatus. Value of the
> column can be 0 or 1. Only users with correct username and status 1 can
> login.
>
> How can i do this with j_security_check?
Mark's suggestion of using a VIEW is IIRC the only way this will work
with Tomcat's built-in authentication mechanism. You could write your
own Authenticator or you could use securityfilter
(http://securityfilter.sourceforge.net) which lets you implement your
own "Realm" classes as well. In there, you can do anything you want
(such as check additional tables, issue extra queries, etc.).
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkjXm2MACgkQ9CaO5/Lv0PBLTACaA2TzS8s5U2UiEhyEolDwRzAU
1F8AoLgYvUw87c83v+nRX3vZWTe6xHwG
=SPrG
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: j_security_check Tomcat user status
Posted by Mark Thomas <ma...@apache.org>.
Tokajac wrote:
> Hello!
>
> For Connection on database i initialize in context.xml:
> [CODE]
> <Realm className="org.apache.catalina.realm.JDBCRealm" debug="0"
> driverName="com.Driver"
> connectionURL="jdbc:url"
> connectionName="CONNAME" connectionPassword="CONPASS" userTable="BFWBBUSR"
> userNameCol="LOGINNM" userCredCol="USRPASS"
> userRoleTable="BFWBBUSR"
> roleNameCol="ROLEID"/>
> [/CODE]
> j_security_check works fine.
>
> Now, i want to check another column on login: userstatus. Value of the
> column can be 0 or 1. Only users with correct username and status 1 can
> login.
>
> How can i do this with j_security_check?
Use a view rather than a table for userTable that is based on something
along the lines of:
SELECT * FROM BFWBBUSR WHERE userstatus=1;
Mark
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org