Hi George,
It is step 3 and 4 that will give you problems. Fortunately, Matt Daniels has written a nice blog post about letting Mendix automatically log a user into the application. You can validate the user against your API, create the account in a microflow, then perform the auto-login as outlined in the post below.
Check out his blog post here: