I'm using Simplemembership provider in asp.net MVC 4, but I'will change to ASp.net MVC 5 using Asp.net Identity. In my code, using Webmatrix, the table Funcionario is used to authenticate:
WebSecurity.CreateUserAndAccount(funcionario.Login, funcionario.Senha, new
{
Id_Cargo = (short)funcionario.Id_Cargo,
Confirma_Senha = senhaCriptografada,
Nome_Usuario = funcionario.Nome_Usuario,
Senha = senhaCriptografada,
Id_Distribuidor = funcionario.Id_Distribuidor,
Login = funcionario.Login,
Status = 1,
CPF_Usuario = Util.RemoveNaoNumericos(funcionario.CPF_Usuario),
Data_Cadastro = DateTime.Now
});
Is there any way to cutomize my user table like in Webmatrix? Using asp.net identity, the table AspNetUser is created to store the system users. How can I do something like that, but using asp.net identity?
Yes its possible.
Starting from ASP.NET Identity 2.0 , we can extend the default ApplicationUser Class as
This
ApplicationUserclass will have all the basic properties of Identity user and the addition properties. Then in your controller create a property using theApplicationUserclass as