Start a new topic

Create several Users through business logic?


just a quick question to avoid wasting time:

The idea:

A leader can create groups in our application and then the users can join this group. No it would be nice for the leader to create users for all people who are lazy. ;)

So my idea was to create a endpoint function to create user instances and save them. (With a default password and on first login prompt to change it...)

Is this possible? Cause on application-side after creating a new user it always tries to login in directly. (avoiding this through a directly called logout, and than prompting email-verification.)

An answer would be great.

Best, Nico

Hi, while you should not create users directly using the collectionAccess module, you can certainly use the request module to create users using the REST API (
Ah ok - could you explain where is the difference? (in 1 or2 sentences)
The collectionAccess module accesses the database directly, meaning that if you insert into the user collection an entity containing `{"username": "A", "password": "A"}`, the entity created will **only** have those properties. When a new user is created through the proper channels (i.e. using the REST API, which indirectly also includes the libraries), additional properties are also added to the entity -- `_acl`, `_kmd` and others. Most importantly, we also create a salt and store an encrypted password. Thus, for a user to be able to properly use Kinvey, it needs to be created using the REST API.
Ah thanks for that. :)
Login or Signup to post a comment