locked
How To Configure Twitter External Authentication in ASP.NET Core 3.1 Identity RRS feed

  • Question

  • User1827968785 posted

    I've added the Twitter external sign-in NuGet package to my ASP.NET Core 3 app as outlined on the following Microsoft page. I'm using razor pages.

    https://docs.microsoft.com/en-us/aspnet/core/security/authentication/social/twitter-logins?view=aspnetcore-3.1

    Now I'm trying to access and modify the code in the /signin-twitter default callback that was set up automatically by the NuGet installation. Also, I want to setup my own DefaultScheme to process authentications.

    I have 2 questions.

    1) How do I access and modify the code in the /signin-twitter default callback that is set up automatically by the Twitter authentication NuGet package? There is no /signin-twitter file or component in the application file structure. And a search does not find "signin-twitter" text mentioned in any file. Where is the /signin-twitter code located?

    2) On the page in the link above, under the section titled 'Configure Twitter Authentication', you'll see verbiage that says "The AddAuthentication(String) overload sets the DefaultScheme property". But the doc has no example that shows how to do this. How do I set up my own DefaultScheme to process authentications using AddAuthentication(String)? And what type of code file should it be?

    Any assistance will be greatly appreciated. Thank you in advance.

    Thursday, July 23, 2020 5:46 AM

All replies

  • User-2054057000 posted

    External authentication like Google Plus, Facebook, Twitter can be configured in the same manner in ASP.NET Core Identity. See this tutorial on it. 

    Friday, July 24, 2020 5:36 AM