Create Users for Mobile Applications

Create Users for Mobile Applications

  

Hi there,

    New person here. I have a mobile application project which requires me to create users through my app. My question is how to I do that? I have tried creating a user, but when I enter the username and password in the login page it does not work. By creating a user I placed it in a new screen then created a form. The user is seen at my database but it is invalid. 

Solution

Hello Raphael,


Users module has an API that enables you to create users on demand. It's in the form of an action named 'User_Create'. Please not that, for your user to be able to create that action successfully they need to be granted the role UserManager, from the same module.


Cheers

Solution

Pedro Cardoso wrote:

Hello Raphael,


Users module has an API that enables you to create users on demand. It's in the form of an action named 'User_Create'. Please not that, for your user to be able to create that action successfully they need to be granted the role UserManager, from the same module.


Cheers


Thank you for the information. I have a follow up questions. How do I implement that,because before I create a user, the app says it has to be a UserManager first? Do I create a user first and use the User_Create, then the UserManager? How do I implement that?


Are your regular users the ones that will be creating the 'other' users? if so, you might consider granting them the role before the logic that creates the user and revoking it after. If not, you can grant it in the Users UI. 

If you can explain the flow of your app it's easier to help...

So the flow goes like, There is a login screen, and if new users would want to sign up and create an account for them to use my app there is a button that would say "Sign Up." After clicking the button they would be directed to a sign up screen. This would be new users so I would like them to be able to access our app without going to the  Outsystem website. I am also attaching pictures for visual aid. For the logic part I am not sure how to do it exactly I was just testing that part out.

There are components is the Forge for User Registration.  Do a search and you'll find them.  While they are designed for a web application you should be able to customize it to work for your mobile app.

Hope this helps,
Curt


Now I got confused with that OutSystems website comment :|

So, in that registration screen, when you hit "Save" should the user be automatically able to login? If so, just do as I told before, in the "Save" action, grant the role, create the user, revoke the role.

Ok will do thank you. Here I have attached the logic can you tell me if it is correct?

That's the action that you want to call, and yes, you should do it after validating the form. You probably want to encapsulate that logic in a server side action of yours, cause you still need to grand and remove that role I talked about.

Thank you Pedro.