You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to override functionality of: vendor/league/oauth2-server/src/Grant/AuthCodeGrant.php to add another information on the authorization code (the tenant id), will also have to decrypt it later but for now I would be very happy to know how to override this one first.
So far I can say I have no idea how to do this, used some GPT help on a service provider but no success:
public function register(): void
{
Passport::ignoreRoutes();
// Bind the AuthCodeRepositoryInterface to an implementation
$this->app->bind(AuthCodeRepositoryInterface::class, AuthCodeRepository::class);
// Optionally bind the RefreshTokenRepositoryInterface if you haven't done so
$this->app->bind(RefreshTokenRepositoryInterface::class, RefreshTokenRepositoryInterface::class);
parent::register();
$this->app->extend(AuthorizationServer::class, function (AuthorizationServer $server) {
$grant = new MyCustomAuthCodeGrant(
$this->app->make(AuthCodeRepositoryInterface::class),
$this->app->make(RefreshTokenRepositoryInterface::class),
new \DateInterval('PT10M')
);
$server->enableGrantType($grant, new \DateInterval('PT1H'));
return $server;
});
}
Those bind didnt help at all, got this error message:
Target [League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface] is not instantiable while building [Laravel\Passport\Http\Controllers\AuthorizationController].
The text was updated successfully, but these errors were encountered:
App::extend(AuthorizationServer::class, function (AuthorizationServer$server) {
App::singleton(AuthCodeRepositoryInterface::class, AuthCodeRepository::class);
App::singleton(RefreshTokenRepositoryInterface::class, RefreshTokenRepository::class);
$grant = newAuthCodeGrant( // this is my custom AuthCodeGrant, I used the same nameresolve(AuthCodeRepositoryInterface::class),
resolve(RefreshTokenRepositoryInterface::class),
new \DateInterval('PT10M')
);
$server->enableGrantType($grant, new \DateInterval('PT1H'));
return$server;
});
I need to override functionality of: vendor/league/oauth2-server/src/Grant/AuthCodeGrant.php to add another information on the authorization code (the tenant id), will also have to decrypt it later but for now I would be very happy to know how to override this one first.
So far I can say I have no idea how to do this, used some GPT help on a service provider but no success:
Those bind didnt help at all, got this error message:
Target [League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface] is not instantiable while building [Laravel\Passport\Http\Controllers\AuthorizationController].
The text was updated successfully, but these errors were encountered: