Creating a user manually through a microflow

1
Hi!   I need to create a user account via the startup microflow, however, I'm unable to do that. I think the issue is that I'm setting the password as a String instead of a Hashed string. But how can I set it as a hashed string without downloading any dependencies?
asked
2 answers
4

Some things to check;

  1. What does your after startup return?
    It must be a boolean and value true, if returning false, the startup will be terminated.
  2. Check the password you set for the user.
    This must be a string, which meets the password policy as set in the security configuration

    Security configuration

     
  3. Do you assign a UserRole to the new user? 
    A UserRole must be set. otherwise the user will not be able to login.
    The UserRole you want to assign must be retrieved first from database

    Retrieve the role


    Assign UserRole
answered
5

Hi Elina,

here are the steps to create a user account via the startup microflow in Mendix:

  1. Open your startup microflow or create a new one if you haven't already.
  2. Add a Create Object activity to the microflow and select System.User as the entity to create.
  3. Set the attributes of the System.User entity as desired, including the Name, UserRoles, and any other relevant attributes.
  4. Use the Encryption module to hash the password of the user before setting it in the System.User entity. You can do this using the Encryption > HashString action in a Change Object activity. Set the input parameter to the plain-text password, and set the output parameter to the Password attribute of the System.User entity. This will ensure that the password is stored securely in the database.
  5. Add a Commit activity to the microflow to save the new user to the database.
  6. Test the microflow by running the application and checking if the user account has been created successfully.

Let me know, if you face any issues,

Hope it helps!!

answered