Add Users and Roles in Event Script

Hi Adnan,

You can do this if you set up your User Source with a type of Database, meaning that the user and role details are stored in a SQL database. You can then create a script to write directly to the correct tables: user details go in the auth_users table, roles in the auth_roles table and users are mapped to roles in the auth_user_rl table.

The easiest thing to do is create a User Source with a type of Database and add a dummy user before looking at the tables to see how those details are stored. Note that the user’s password is stored as an MD5 hash. Creating a user in MySQL would look something like INSERT INTO auth_users SET username='John', passwd=MD5('password'), fname='John', lname='Smith', schedule='Always', language='en';