TurgutEfeYksel Dökümanları (https://laravel.com/docs/8.x/passport) okursanız eğer şöyle bir kod görürsünüz:
$guzzle = new GuzzleHttp\Client;
$response = $guzzle->post('http://your-app.com/oauth/token', [
'form_params' => [
'grant_type' => 'client_credentials',
'client_id' => 'client-id',
'client_secret' => 'client-secret',
'scope' => 'your-scope',
],
]);
return json_decode((string) $response->getBody(), true)['access_token'];
Gördüğünüz gibi tüketici istemci token almak için grant_type client_credentials olmak üzere client_id ve client_secret ile istek atıyor. Sonra da dönen token ile API'ınızı kullanacak.
Önce burası:
https://www.oauth.com/
Sonra burası:
https://laravel.com/docs/8.x/passport
Buraları iyi öğrenmeniz lazım. OAuth basit bir konu değil; siz çok yüzeysel yaklaşıyorsunuz.