Users created dynamically can not login
Question

Hello,

In my application I have the Role Admin that can create new users. That users can do login in the application.

I created a server action where I call the CreateUser method from Users Entity and add the role I want for that user. 


This work well. If I go to the User Application I can see my new users and the correct role assigned to him.

The problem is when that new users try to login in the application they have an error and can not enter in the application.


I am doing something wrong? Why my users can not login?

mvp_badge
MVP
Solution

Hey Pedro,

Hope you're doing well.


You need to encrypt the user's password before storing it in the database.

In order to do that, you need to use EncryptPassword action from Users module:


The result of this action (output EncryptedPassword) should be the value that you need to pass to your CreateOrUpdateUser action.


Hope that this helps you!


Kind regards,

Rui Barradas

Thank you.

This solved my problem.

Hello,

Maybe an idea... do you encrypt your user's password before adding it to the database? 

Ben

Hi Pedro,

I believe the username would be the email which we enter through UI from user module. So, please check and try to enter username as entered email address when you created the new user. And check the data into your user entity to make sure correct data have been saved into the respective attributes along with password.

Also, If possible, please share your OML to look into the issue? 

Thanks & Kind Regards,

Sachin

mvp_badge
MVP
Solution

Hey Pedro,

Hope you're doing well.


You need to encrypt the user's password before storing it in the database.

In order to do that, you need to use EncryptPassword action from Users module:


The result of this action (output EncryptedPassword) should be the value that you need to pass to your CreateOrUpdateUser action.


Hope that this helps you!


Kind regards,

Rui Barradas

Thank you.

This solved my problem.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.