Why User registration and login not working
Application Type
Traditional Web

Hi,

I am creating few users using User API and users are getting created properly in user portal.

When I try to login for that newly created user, login failed with same user and password what I used while creating user.

If I go to the portal and set a new password for that user, then only it is working.

I debugged and saw while saving I am passing the password and If I do get User Password also coming. Then why same password does not work unless I explicitly set in the portal. Attaching sample app oml file.

Also I see GetUser of UserAPI  returns password in plain text, then what is the security of user password in OutSystem.

SampleRegistrationApp.oml

Solution

Hello Biswajit, I think you forgot to pass the password.

What I add was the assignment of the password and I did the encryption.

Now, you are adding a Password, and never forget to put the encryption as you can see on the flow, I am using the server action to do that, and then I assign the encrypted password to the password attribute for the user that I am going to create

But yeah, give it a try. 

Kind regards,

Márcio

SampleRegistrationApp.oml

Thanks Marcio, it is working now. I did not realize a explicit encryption is required. I thought Outsystem will automatically create a hash before saving.

No problem, I've already been in your place (in this case, the problem with the encrypted password and not knowing how to pass the information to create a new User) and everything is fine! :)

You have all sorts of functions on Users, give it a look just to know what you can use! :)

Continue the good work!

Kind Regards,

Márcio

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