Welcome to the jGuard's wiki » jGuard Documentation » JdbcAuthenticationManager

JdbcAuthenticationManager

Last modified by XWikiGuest on 2010/10/28 19:42

JdbcAuthenticationManager

Description

This AuthenticationManager implementation permits to persist in a database all the authentication informations of your application.

you can either establish connections through Driver parameters, or by a DataSource grabbed with a JNDI reference.

  • Driver parameters
this option is more easy to test in development environment.
  • Datasource grabbed via JNDI
this option should be prefered in production environment, because it uses the connection pool provided by the application server used. to configure this connection pool, please refer to the documentation of your application server vendor.

parameters

namemandatoryvaluesdescriptionexample
database Driverno  com.mysql.jdbc.Driver
databaseDriverUrlnoa Jdbc compliant url jdbc:mysql://10.0.0.10/jguardexample
databaseDriverLoginno any valid database user login 
databaseDriverPasswordno any valid XML path relative to database 
authenticationXmlFileLocationno any valid XML file path relative to webapp.this file will be used to import data into database if the database is empty 
authenticationDatabaseFileLocationno any valid properties file path relative to webapp specific to the database used.:this properties file contains SQL queries realted to your database. this properties file contains SQL queries realted to your database. the Oracle properties one, is valid for oracle 9i and higher 
JNDIno any valid JNDI reference 

configuration with Driver parameters

....
....
 <authenticationManager>net.sf.jguard.authentication.JdbcAuthenticationManager</authenticationManager>
		<authenticationManagerOptions>
			<option>
				<name>databaseDriver</name>
				<value>com.mysql.jdbc.Driver</value>
			</option>
			<option>
				<name>databaseDriverUrl</name>
				<value>jdbc:mysql://10.0.0.10/jguardexample</value>
			</option>
			<option>
				<name>databaseDriverLogin</name>
				<value>jguard</value>
			</option>
			<option>
				<name>databaseDriverPassword</name>
				<value>jguard</value>
			</option>
		    <option>
				<name>authenticationXmlFileLocation</name>
				<value>WEB-INF/conf/jGuard/jGuardUsersPrincipals.xml</value>
			</option>
		    <option>
				<name>authenticationDatabaseFileLocation</name>
				<value>WEB-INF/conf/jGuard/authentication.mysql.properties</value>
			</option>
		</authenticationManagerOptions>
....
....

configuration with JNDI Datasource

....
....
 <authenticationManager>net.sf.jguard.authentication.JdbcAuthenticationManager</authenticationManager>
		<authenticationManagerOptions>
			<option>
				<name>JNDI</name>
				<value>java:/comp/env/jguard</value>
			</option>
		</authenticationManagerOptions>
....
....
Tags:
Created by diabolo512 on 2006/05/22 14:35

jGuard team copyright 2004-2009
3.1.1