How to achieve social authentication using only some of the features of ASP.NET Core Identity RRS feed

  • Question

  • 1. What I want to know.

    I am trying to plug-in external authentication function into a ASP.NET Core web application that was originally created without Identity, but it does not work well. I would like to know how to achieve this.


    I am trying to embed social login functionality into an authentication system created using WebForm in ASP.NET 4.0.In order to achieve this, I have created a separate Web Service in ASP.NET Core, and made a call from the ated by WebForm authentication system.

    To realize this requirement, I created a web application in ASP.NET Core that uses Identity, and copied a part of the razor page program created by Scafolding to accept the Post instruction from the outside. The target razor page is ExternalLogins.cshtml and its cs sourc in the /Area/Pages/Identiy/manager folder. I've tried it and it works as I intended.

    So next, I created a plain ASP.NET Core web application without Identity and later tried to achieve the external authentication functionality by adding the Nuget package and modifying the Proguram and Startup class. The reason for this is that I don't need Identity anything other than retrieve external authentication. But in this case, the external authentication does not work well.

    3. cause
    When using the latter program, the request does not reach the SNS authentication page specified in the external authentication configuration file when performing external authentication. Specifically, the OnPostLinkLoginAsync method in ExternalLogins.cs receives the request correctly, but after the method returns the ChallengeResult, an error occurs on the authentication page on the SNS side and the page transition is interrupted.

    4. what I want to know more specifically.
    After all, in order to use Identity's external authentication features, do I have to specify that Identity is to be included in the first step of creating a web application?

    I thought that if the Nuget Package used by the two web programs was the same and the contents of Proguram.cs and Startup.cs were the same, the behavior of the two programs would be the same, so I'm a little confused by this error.

    5. Reference.
    A sample program is available on GitHub to test this case study. If you are interested, please refer to the following URL
    The application ID and Secret information of SNS and the SQL Server connection information used by Identity will need to be rewritten by the user, but it should be easy to implement if you are ready for them. Details of how to set up the program is written in Readme.txt in the "Document" folder.
    Please give it a try.

    • Edited by TrailRunner-MF Sunday, September 13, 2020 5:24 PM
    • Moved by CoolDadTx Monday, September 14, 2020 2:53 PM ASP.NET related
    Sunday, September 13, 2020 5:22 PM

All replies

  • https://forums.asp.net/

    They do a lot of different things with security in ASP.NET forums.

    Sunday, September 13, 2020 9:03 PM
  • Thank you DA924x.

    I've redirected this Post to the following thread in ASP.NET Forum.


    Hope I will have a reply there.

    Monday, September 14, 2020 5:06 AM