I'm currently reading the documentation on Laravel Passport on skipping the authorization prompt for a first-party client. I have protected routes based on the scopes the clients request which a typical user would authenticate however, I am using Laravel passport as a Single-Sign-On server for my first party applications as well as third party and to this effect want to skip authorization only for first-party clients.
It is key to note that the scopes should still apply with or without an authorization prompt. My first-party client will still send scopes relative to the user, I just want to skip the authorization prompt and instantly redirect after login.
I created a model as the documentation suggests:
namespace App\Models;
use Laravel\Passport\Client as BaseClient;
class Passport extends BaseClient
{
public function skipsAuthorization()
{
return $this->firstParty();
}
}
However, it doesn't not mention how to generate clients that are first-party, or how to upgrade a current client to a first-party client.
On inspection of the Database table oauth_clients there is no relative column or foreign table that would suggest a client is a first-party.
To this effect, I am under assumption that the $this->firstParty() needs to be implemented in the Passport class and a migration should be created to add a is_first_party column.
To this effect, the documentation further references Overriding default models however, the documentation shows that the Client class is the default value for Passport::useClientModel but the created model suggests extending BaseClient.
Any help appreciated.
