'Adding Google authentication to ASP.NET with Angular Visual Studio template

I have a project that I created with the ASP.NET with Angular Visual Studio template with the individual accounts authentication type.

I then added Google authentication by following the steps outlined here.

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

However, when I try and register, I get a error in the console stating

Error: Cannot match any routes. URL Segment: 'signin-google'.

I tried following the exact same steps but with asp.net core web app using razor pages instead of angular, and it works properly. Is there something that I am missing with Angular?

Thanks for any suggestions



Solution 1:[1]

I managed to fix my problem. Angular was taking over the routing, when asp.net Identity should have been taking over. I fixed it, by changing the redirect URL for google by adding this line "googleOptions.CallbackPath = new PathString("/Identity/signin-google");" to my Program.cs file.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Phadon Phipat