Hi,
I am using Asp.net Core Identity.
To enable additional user information, I created a class, let's say "MyUser" with a number of custom properties, and made sure these correspond to columns in AspNetUsers.
In ConfigureServices, I added:
services.AddIdentity<MyUser, IdentityRole>();
And I get this using dependency injection in my controllers
Now I can get the full user class with:
var user = await _userManager.GetUserAsync(HttpContext.User);
The user contains the default properties (UserName, Email, etc), but also my additional properties from the MyUser class.
This gives me direct access to the properties on the user I want to keep.
I would like to hear your views on this. How far can you extend this, is there a line that I should not cross? For example, i would like to store an encrypted json string that contains the users smtp server data (server, port, SSL/TLS, uid, password). I can also store that in a separate table and do a lookup using the user.Id as the key, but storing it in AspNetUsers is more convenient.
Any thoughts, ideas, concerns?
Thanks
Pieter