Hi, This won't work as it requires all the OAuth logic to be implemented via the Angular UI? There is no Javascript SDK for Strava OAuth like there is for Facebook\Google.
The reason I have decided to implement the MVC controller\authentication from the aspnet zero MVC project is because there is one written for .NET MVC based AspNet.Security.OAuth which is AspNet.Security.OAuth.Strava. This works PERFECTLY under your MVC project. So its easier to just add the MVC controller to the Angular project just for the sign in (similar to how you had the original Angular JS working).
I also tried to add the Google authentication via MVC to ensure it isn't my Strava OAuth. I did this with AuthConfigurer.cs by adding. app.UseGoogleAuthentication(new GoogleOptions { ClientId = "{myClientId}", ClientSecret = "{mySecret}" }); This had the exact same result, everything worked except the external login info returns null. var externalLoginInfo = await _signInManager.GetExternalLoginInfoAsync(); always returns null.
So what I need to know, what do I need to add to the Core\Angular project to get the MVC External Login to work? From what I can tell all the StartUp.cs is nearly the same between Angular and MVC projects.
Thanks, Matt
Hi, I have found a Strava OAuth provider via <a class="postlink" href="https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers">https://github.com/aspnet-contrib/AspNe ... .Providers</a>
This is working perfectly when add to the aspnet zero MVC Core project. I have tried to migrate over the AccountController to the Angular 2 project, this way I can use MVC just to provide the 3rd party login\registration.
Everything seems to work correctly, I can see AspNet.Security.OAuth.Strava getting all the user details in the CreateTicketAsync function. The function ExternalLoginCallback gets called but the problem is within this function the externalLoginInfo is always null.
var externalLoginInfo = await _signInManager.GetExternalLoginInfoAsync(); always returns null.
I think this might be an issue with Cookie External Authentication, is there something I am missing to get this to work in the Core/Angular project?
Thanks, Matt
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
Hi, Checking if there is an issue with IE11? How do I check the version per your request? Note this is Angular 2.
Thanks, Matt
Hi, Ok interesting, it works in Chrome but doesn't in IE11. How do I check the version? I only downloaded the new project yesterday.
Thanks, Matt