0

I need to implement external logins and had no problem with Facebook and Google since they are supported but I'm stuck at LinkedIn. I am not exactly a beginner but I'm not very experienced at this either. Prior to this post I viewed a thousand explanations and most of them were vague, others just didn't work and others were explained for advanced people.

What I've tried:

-using cookies in the Configure method, but the methods were deprecated (I figured they were not for the 2.0 version). I also tried app.UseLinkedInAuthentication(...) from Microsoft.AspNetCore.Authentication.LinkedIn to no success.

-writing a service in ConfigureServices (but I didn't get it to work, I assume this is where I need to do it). I also tried this but they were talking like they knew what they were doing.

So to keep this simple, I made a default MVC ASP.NET Core 2.0 application in Visual Studio 2017. All I need to do is write stuff in Startup.cs, so my question is, what is it that I have to write and why? Thank you very much in advance.

PS: I would appreciate an explanation in the comment, if it's a link I probably already visited it :)

Megid
  • 105
  • 12

1 Answers1

1

There is AspNet.Security.OAuth.Providers repo that provides a collection of security middleware to support social authentication providers. Corresponding releases can be found using this link: https://www.nuget.org/profiles/aspnet-contrib (all packages that start from AspNet.Security.OAuth)

Unfortunately, the current master branch is only for ASP.NET Core 1.0 and so nuget packages like package for LinkedIn were published only for that version, but you may clone the repo and switch to experimental branch that is an on-going port to ASP.NET Core 2.0.

Look into this github issue if you need the current status of porting.

By the way, according to this github issue, the LinkedIn authentication provider has been ported already.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Set
  • 47,577
  • 22
  • 132
  • 150
  • I think this may be what I'm looking for, but I don't really know how I can add the package to my project. Could you explain to me? – Megid Oct 10 '17 at 18:59
  • 1
    @Megid you have 2 options while the new version of Nuget package not released: clone code locally from experimental branch and then (1) add a reference to the `AspNet.Security.OAuth.LinkedIn` in your project (add`ProjectReference` in .csproj) or (2) create locally the own version of nuget package and then add a dependency to this package using own nuget feed (local feed for example). Look into [How do I import a .NET Core project to another .NET Core project](https://stackoverflow.com/a/38346544/2833802) for more details – Set Oct 10 '17 at 19:12