I'm trying to implement facebook auth using SPA - Angular 6 and backend API - Laravel with Dingo/API.
When I try to redirect and return to SPA the page
public function redirectToProvider()
{
return Socialite::driver('facebook')->stateless()->redirect()->getTargetUrl();
}
By some reason response comes from http instead of https according to error.
[blocked] The page at https://www.domain/ was not allowed to display insecure content from http://api.domain/auth/facebook.
Although, I've set up my domains both to be on https and redirect all http requests to https. Moreover, I'm calling https://api.domain/auth/facebook with GET method.
As I mentioned in another question, there are few ways to make laravel work using https protocol:
Configure your web server to redirect all non-secure requests to https. Example of a nginx config:
Set your environment variable
APP_URLusing https:Use helper secure_url() (Laravel5.6)
Add following string to AppServiceProvider::boot() method (for version 5.4+):
Implicitly setting scheme for route group (Laravel5.6):