Start a new topic

Create several Users through business logic?

Hey,





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




Ah thanks for that. :)
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 ok - could you explain where is the difference? (in 1 or2 sentences)
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 (http://devcenter.kinvey.com/rest/guides/users).
Login or Signup to post a comment