You two options.
- Allow the external system to login into your app and give them the option to create an access token for them on their account.
- The external system can create access token using the passport endpoint like below
$http = new GuzzleHttp\Client;
$response = $http->post('http://your-app.com/oauth/token', [
'form_params' => [
'grant_type' => 'password',
'client_id' => 'client-id',
'client_secret' => 'client-secret',
'username' => '[email protected]',
'password' => 'my-password',
'scope' => '',
],
]);
return json_decode((string) $response->getBody(), true);
Read this more info https://laravel.com/docs/5.4/passport#password-grant-tokens