While I was developing an API for a mobile app, I faced the issue of how I could implement a social authentication (Facebook, Google) between our mobile app and our API. I knew about Laravel’s Socialite package for implementing that in the web (with redirects and callbacks…
After some search and testing I figured out the best way of doing this, with best practises and security in mind. This is a clear and co mplete implementation flow and example, of how I achieved that easily with Laravel, Laravel Passport and Laravel Socialite.
I skipped the setup process of Laravel, Passport, Socialite and extra checks, try-catch blocks etc.