Insert user via Identity ASP.NET

Asked

Viewed 89 times

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. Inside AccountController has the Action ExternalLoginCallback. You can work with her.

  • I’m not sure what to call the inside of this control

  • @Thiagop Do you want to validate how? Name? Id? Email? All?

  • @Thiagop More or less like this Login without using standard Identity

  • @LINQ will use the email field I received from the API to be the user

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.