Base solution for your next web application
Open Closed

Core with OWIN Integration #3190


User avatar
0
ribbo created

Hi, I am trying to add an OWIN integration login using Angular 2 and .NET Core. From what I can see .NET Core version isn't compatible to add OWIN integration yet? If not, is this planned or are there instructions on how to add it?

Thanks, Matt


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    For .Net Core owin is not supported but for .Net 4.6.1 it is. I couldn't understand >"I am trying to add an OWIN integration login" , can you explain a bit more ?

    Thanks.

  • User Avatar
    0
    ribbo created

    Hi, What I am trying to do is an external login via Strava (<a class="postlink" href="https://strava.github.io/api/v3/oauth/">https://strava.github.io/api/v3/oauth/</a>), similar to Facebook\Google login. It uses OAuth 2. This is using Angular 2 ASP.NET Zero. I previously had this working on the base aspnetboilerplate framework AngularJS as it used MVC for its core login system. I added an OWIN Middleware that slotted in very nicely and everything worked. But because there aren't all the MVC related Server Side URL's the same concept doesn't seem to work.

    I am having a lot more trouble getting my heard around the Angular 2 version with ASP.NET Zero as it is completely different using client side JS far more from what I can see. To do Facebook\Google it seems to be using complex helper SDK JS libraries from each login provider. Are you able to point me in the right direction to add a 3rd party External Login via OAuth 2?

    Thanks, Matt

  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    OWIN works if you select .net framework 4.6.1 as the framework for our aspnet.core solution. We are using SignalR over OWIN integration. See code: <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Host/Startup/Startup.cs#L158">https://github.com/aspnetzero/aspnet-ze ... up.cs#L158</a> You can add additional OWIN middleware here.

    For the Angular2 version, we have completely seperated client side from server side. They communicate via AJAX and client authenticates via JWT tokens, not by cookies. So, for token authentication, integrating to 3rd party auth providers are completely different. Client authenticates to Facebook (using Facebook's official js library), gets an access token and send to server. Then server uses the access token to validate and get additional user informations from the facebook. For authenticate to another login provider, you should follow their documentation. They should support similar client side auth normally, because we are using standard OAuth protocol.