Network/user/tutorials/mysql-migration-handler

MySQL Migration Adapter
There is a built in adapter for authenticating against an existing MySQL database.

You can enable the MySQL adapter by placing (or editing) the following property file in classpath. In Tomcat this can be TOMCAT_HOME/lib/ for instance.

user-service.properties

In the property file you need to set the following properties (populated with example data below):

user.service.migration.mysql.active=true user.service.migration.mysql.url=jdbc:mysql://localhost:3306/test?autoReconnectForPools=true user.service.migration.mysql.driver=com.mysql.jdbc.Driver user.service.migration.mysql.username=cbn user.service.migration.mysql.password=cbn user.service.migration.mysql.table=users user.service.migration.mysql.column.id=id user.service.migration.mysql.column.user=username user.service.migration.mysql.column.password=password user.service.migration.mysql.md5=false user.service.migration.mysql.auth.local=false
 * 1) Legacy MySQL migration

Some explanations:

user.service.migration.mysql.active Should be set to 'true' or 'false'. This will decide if the MySQL adapter will be used or not. Default is false.

user.service.migration.mysql.md5=false If true then we will assume that the data in the password column is hashed with MD5 and will match the password with an MD5 hash.

user.service.migration.mysql.auth.local If true then User Service will try to authenticate locally first. If this is successful then no call will be made to the MySQL. Set this to true if you want to migrate your user once only. Set this to false if you always want to check the password with the MySQL database.