I have the following stack - Angular 2, Net Core 2.1 and am using Identity. I want to add the option for Google authentication and have found some limitations using the client side gapi libraries - the main one being its a no go if 3rd party cookies are not allowed.
This led me to try implementing Google authentication on the server side. Initiating an http request from Angular to my externallogin endpoint results in a CORS issue as seen here as seen here and here. I can successfully authenticate with Google by directly using my externallogin endpoint or with Angular using document.location.href. Using document.location.href seems like - the wrong way to implement this. I've been working with Net Core and Angular for quite some time but this one has me stumped. Is there a valid way to implement this or have I designed my self into a dark corner and am forced to use document.location.href?
- I have properly set the Authorized Javascript Origin and Authorized redirect URIs on the Google API console.
- I have CORs properly set on my server
- Angular and Net Core (front and back ends) are on the same server.
I'm not sure how or if I can properly handle the redirect after the authentication Challenge on my backend, when the request originates from an Angular http get request.