diff --git a/app/Containers/VikonIntegration/Providers/VikonServiceProvider.php b/app/Containers/VikonIntegration/Providers/VikonServiceProvider.php index 5a8f75a..395b97f 100644 --- a/app/Containers/VikonIntegration/Providers/VikonServiceProvider.php +++ b/app/Containers/VikonIntegration/Providers/VikonServiceProvider.php @@ -28,6 +28,7 @@ class VikonServiceProvider extends ServiceProvider $this->app->singleton(ValidateTokenTask::class, fn ($app) => new ValidateTokenTask( http: $app->make(HttpTask::class), + clientId: config('vikon.client_id'), )); $this->app->singleton(RefreshTokenTask::class, fn ($app) => new RefreshTokenTask( diff --git a/app/Containers/VikonIntegration/Tasks/ValidateTokenTask.php b/app/Containers/VikonIntegration/Tasks/ValidateTokenTask.php index d1a211e..0696bc7 100644 --- a/app/Containers/VikonIntegration/Tasks/ValidateTokenTask.php +++ b/app/Containers/VikonIntegration/Tasks/ValidateTokenTask.php @@ -8,16 +8,17 @@ class ValidateTokenTask { public function __construct( private readonly HttpTask $http, + private readonly string $clientId, ) {} public function run(string $accessToken): bool { try { - $response = $this->http->getWithToken( - 'api/profile_applicant/check_access_token', - $accessToken, - 'auth' - ); + $response = $this->http->post('oauth2/resource/token/introspect', [ + 'client_id' => $this->clientId, + 'access_token' => $accessToken, + ]); + return $response->successful(); } catch (\Throwable $e) { Log::warning('Vikon token validation failed', ['error' => $e->getMessage()]);