Take a look at this post it is well written and I believe it covers everything that you need:
https://itnext.io/laravel-api-authentication-for-social-networks-oauth2-social-grant-3ec1085b58b6
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am building a project and this project needs authentication in an API in another project. And other services will be used by REST API, so Laravel will work as a Client.
My application build on Laravel 5.8, I need to authenticate the users in a other API (third party API), these API are code in REST with oAuth2. So, I want send a username, password, appid & appsecret to the URL-API and the callback is if the user is valid then authorized to use the APP.
How I can make this?
Please or to participate in this conversation.