How to make a registration form?

I know that in Mendix you can have anonymous users to let people into your application. But how can they transfer from Anonymous User to User?  Within mendix there are some athentication add-ons, but those are for logging in and out (And need a sign in button, which is useless for registration) Right now, I have a form where can people can put a username and a password. But this way, they only get added to a User Enitity, and when I try to log in as them, it won't work.  My registration form 
2 answers

One of my Expert Devs, Matt Daniels, created a module you can download and implement to log people in without it forcing them to logout and back in upon account creation (not visibly):


Hi Jelle,

The problem might be that Mendix is designed in such a way that normal and anonymous users are by default not allowed to change accounts of other users. Preferably you want to keep it this way and don't change anything in the security settings on user account mangement.

A user can only login with an account which is a (specialization of) System.User object.

My approach would be as follows:

  • Create a non-persistent entity containing all attributes needed for regsitration
  • After registration, create a microflow which creates the user account (make sure to add some validations to the input data)
  • After creating and committing the user account, the user can login.

If you would like to have the users automatically being logged in after creating the account, you would have to revert to custom Java and a Custom Login handler. For more information on this, although the blog post is pretty old, it still applies:

Hope this helps.