How can one bulk create users?

Is there any possible way to create a bunch of users by using the automation api or another mechanism. The import information would include their email, username, password, and a single group in which they should be a part of.

1 votes

2 answers

1796 views

ANSWER



Users are usually managed in a database or a LDAP.

Benjamin pointed you a first solution. There may be a lot of various ways.
Do you want to do it by programming, scripting or configuring? With what kind of source (file, SQL, form, …)? Do you want to do it once or repeatedly, for initializing a server or regularly adding users on a running server?

Depending on how/where your users are currently managed, you can also simply feed Nuxeo with that source of users and groups.
See Directories and Vocabularies, Authentication, users and groups, UserManager and SQLDirectoryFactory which can be provided a dataFile to initially populate the users or groups table.

For running benchmarks, tests, trainings, …, there's also the easy use of “virtual” users.

2 votes



I was hoping to have a scripted way to accomplish this, but given that does not exist it seems to make more sense to have another tool for managing users. I am already running a multidirectory with a mix of LDAP and local SQL users. It seems pointing to another CMS like a Drupal install could be useful for something like what I need. That would enable users to sign up themselves and manage their passwords. Also, admins could approve the accounts and assign them to roles easily. I might explore exposing a Drupal database of users to Nuxeo.
02/04/2012

Please edit your post if you're looking for more features about users management: the scripted way that's been presented to you is an SQL import in the directory. Automatic signup of users is a feature that would be nice to add, but i'm not really sure what's the bulk process you'd like to do with it, so i'm setting the answer as valid for now.
02/10/2012


Not direclty, I think.

But I'm sure create your own operation can be really easy that takes a CSV file.

  • Create an empty project with Nuxeo IDE.
  • Create an empty operation operation in it that takes a Blob as input
  • parse the CSV and create a SQL query that populates the table user (if you kept the default configuration.

You can use maybe org.nuxeo.ecm.directory.sql.SQLHelper#loadData.

Hope this will help you.

2 votes