How to make system login in the site using account of Instagram, Twitter or Google+ in Platform .NET (C #)

8

I want to develop something like this but I do not have any references how to do it, could you help me with some examples?

    
asked by anonymous 08.04.2015 / 16:46

1 answer

9

Start with an ASP.NET Identity sample system. In this answer I teach the step by step .

Two automatic files must be created in the process:

  • Startup.cs (root directory);
  • App_Start/Startup.Auth.cs .

Startup.cs calls Startup.Auth.cs . Note that Startup.Auth.cs should have the following lines:

        // Uncomment the following lines to enable logging in with third party login providers
        //app.UseMicrosoftAccountAuthentication(
        //    clientId: "",
        //    clientSecret: "");

        //app.UseTwitterAuthentication(
        //   consumerKey: "",
        //   consumerSecret: "");

        //app.UseFacebookAuthentication(
        //   appId: "",
        //   appSecret: "");

        //app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
        //{
        //    ClientId = "",
        //    ClientSecret = ""
        //});

This is where the integration providers with the most established Internet services are configured.

In addition, a Partial ( Views/Account/_ExternalLoginsListPartial.cshtml ) is created that creates the buttons for integration with providers set to Startup.Auth.cs .

For the Instagram case, there is the excellent Auth0 package that simplifies the whole process for you.

    
08.04.2015 / 17:28