1
I am developing an application in ASP.NET
where I am using Identity
.
I have some initial functions from a External API that are called when I am validating the Token of this API via controller
.
The fact is I need it inside of mine controller
, check if the user is already registered on my system and if not, I need to register it, all this within this controller, so that I can redirect the user to certain places.
Follows excerpt from my code
Rootobject DadosUser = new JavaScriptSerializer().Deserialize<Rootobject>(RetornoUser);
var IDUsuario = DadosUser.id;
var UsuarioLogin = DadosUser.nickname;
var UsuarioPrimeiroNome = DadosUser.first_name;
var UsuarioSegundoNome = DadosUser.last_name;
var UsuarioEmail = DadosUser.email;
ViewBag.UsuarioLogin = UsuarioLogin;
ViewBag.NomeCompleto = UsuarioPrimeiroNome + " " + UsuarioSegundoNome;
//INSERINDO NOVO USUARIO
// Aqui preciso verificar se o usuario recebido ja existe no cadastro, e caso não, preciso cadastra-lo
The
Identity
already does it for you. InsideAccountController
has the ActionExternalLoginCallback
. You can work with her.– Renan Carlos
I’m not sure what to call the inside of this control
– ThiagoP
@Thiagop Do you want to validate how? Name? Id? Email? All?
– Jéf Bueno
@Thiagop More or less like this Login without using standard Identity
– Renan Carlos
@LINQ will use the email field I received from the API to be the user
– ThiagoP