LinkedIn External Login in ASP.NET Core 2.0 - asp.net-core

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 :)

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.

Related

Is it required to migrate to GIS when you're using google-oauth2?

This link https://developers.googleblog.com/2022/03/gis-jsweb-authz-migration.html says
Your full suite of apps and platforms may be using different methods of authentication and authorization from Google. The following are NOT affected by this deprecation announcement:
Android or iOS native app SDKs,
Backend platforms directly calling Google’s OAuth 2.0 or OpenID services.
I'm currently trying to understand our huge legacy code which might be affected by the GIS migration. Currently, we just redirect to https://accounts.google.com/o/oauth2/v2/auth to start the oauth2 process, once the user clicks the "Sign in with google" button. I've seen this link in the example of the old way from the migration document here: https://developers.google.com/identity/oauth2/web/guides/migration-to-gis#oauth-2.0-endpoints however I'm not sure if it is required to migrate to GIS or not.
From what I understand, only the frontend related libraries should be worried, but I'm dumb so maybe I'm misunderstanding. Can anyone help enlighten me?
Thanks.
You do not need to migrate if you are directly making calls to the Google's OAuth 2.0 endpoints.
The guide you reference recommends using the library with the note use the Google Identity Services library to support a less intrusive popup UX mode and to avoid having to manage complex OAuth 2.0 requests and responses. The intent there is to simplify your implementation not to force a migration.

Authenticating and ASP.NET Core application with ADFS and SAML

I've searched over Internet and I couldn't find any good resources explaining how to authenticate an ASP.NET Core web application through ADFS using the SAML protocol.
However, I found an old blog post saying that it was not supported and that it would not be until at least .NET Core 2.1. Except of that, I didn't find anything else.
However, I can't believe that something so important is not yet supported...
Does anyone has any experience with that? Note that Azure is not an option here.
Yes you can - see this example using Sustainsys.
You can also use ComponentSpace (examples in that blog) or Rock Solid Knowledge as per this example.

how to connect couchdb with web api core

want to connect to a CouchDb databse from asp.net core web api , but am having trouble finding the code to do so.
Can anyone help me with the code to do that? What is the 'normal' way of doing that?
Cheers!
You can use the MyCouch Library for .Net https://github.com/danielwertheim/mycouch
I had the same need and after evaluating the existing options, I created a set of mechanisms that met the requirements that I had to meet and made available on github and the nuget package.
The explanation of how to use it is on github.
Below is the link in case you want to take a look.
In time, to prevent someone from coming here and deleting my answer, I inform you that I have no intention of promoting what I did with this answer, just suggesting that you evaluate it and if it is your case, feel free to use it.
Link: Nuget Package |
Github
An example webapi core project follows how to make this connection and perform data operations with this lib: webapi core sample

Identityserver4 ldap scenario

I'm planning to use identityserver4 with an LDAP scenario.
Is it a possible and reasonable attempt ? :)
I thought I should implement a LoginService like QuickStart.UI's InMemoryUserLoginService.
And When IS4 will be released officially? Any info about that?
Thanks and regards.
I know it's an old question, but I worked recently on the Ldap (Active Directory or OpenLdap) + IdentityServer4. I created a nuget package and on the github repository you can find an implementation sample.
Here's the Nuget: https://www.nuget.org/packages/IdentityServer.LdapExtension/
I hope it can helps
It's possible and reasonable, it's something you will have to implement on your own which follows the same principle as many other things related to IdentityServer.
We have successfully connected our IdSrv4 to Active Directory using the System.DirectoryServices and System.DirectoryServices.AccountManagement namespaces. Sadly this requires us to run IdSrv4 using full .NET framework since these namespaces haven't been implemented in .NET Core yet.
Reminder: Lookup the area "LDAP injections" before launching your solution, to be on the safe side.
IdentityServer4 1.0.0 was released to NuGet on December 22, 2016: https://www.nuget.org/packages/IdentityServer4/1.0.0

Thinktecture IdentityManager vs IdentityServer

Looking at http://www.codeproject.com/Articles/683732/Thinktecture-Identity-Server-Configuration-Customi and http://brockallen.com/2014/04/09/introducing-thinktecture-identitymanager/ , I am a bit confused about the relation between IdentityServer and IdentityManager.
The way I currently understand it is the following:
IdentityServer can be used as an STS, and to manage users.
IdentityManager can be used to manage users.
Are the above statements correct? Will the users-part be phased out of IdentityServer in the future?
Dominick Baier (one of the authors of IdentityServer) posted this when announcing version 3:
while designing IdentityServer v3 we realized that we really also need a good solution for managing users, identity, claims etc – and that this should be ideally a separate project – so I’d also like to announce Thinktecture IdentityManager
You can read whole blog post here.
I don't know if users-part will be phased out of IdentityServer. The state now is that version 3 does not have GUI administration yet and all configuration is done in code. I am quite sure that Dominick and Brock Allen will eventually implement some web GUI for administration of idsrv but you should ask them maybe by opening a new issue here.
I'm pretty sure IdentityManager is intended to be the GUI for IdentityServer v3+. Therefore, there won't be one built in, as in previous versions.