After a lot of reading and trial and error I got my target design working:
- IdentityServer4 (standalone with AspNetIdentity) with IdentityUser database
- MVC Client (standalone), this is the frontend to the users, no database link at the moment
- 1-n WebAPIs which serve the functionality to the MVC Client and have their own databases
At the moment I use an already existing IdentityUser database and point the IS4 to this database, added roles and claims manually for testing purpose.
My question is about best practice to register new users.
As the MVC Client is the frontend to the user, a link to the user registration should appear here.
But where is the registration technically done?
- Should I do it in the MVC Client (with the default IdentityUser Registration) and point the database to the IS4 database or
- should I add a register function in the IS4 app to keep the MVC Client free of any database dependencies and point the MVC Client "register" link to this IS4 register function?
AccountController
, i.e. register, change password, lock/unlock/delete under Usermanagement, then the answer by @VidmantasBlazevicius is enough, Identityserver is the best place by consistency reasons. If however you mean access control, then look into the answer by @Ruard and put such stuff into a new app, not the one you already have for the business needs.