psn-php icon indicating copy to clipboard operation
psn-php copied to clipboard

Can't login with refresh token. Only with NPSSO

Open VerburgtJimmy opened this issue 1 year ago • 1 comments

I am getting my refresh token with this code for now: `

    $client = new Client();

    $client->loginWithNpsso("npssotoken");

    $refreshToken = $client->getRefreshToken()->getToken();

    Log::error(
        $refreshToken
    );

`

Then I save that refresh token in my DB and I try to login with this code: `

    $token = Psn_token::first();

    log::debug($request->psn);

    $client = new Client();

    $client->loginWithRefreshToken($token);

    $query = $client->users()->me();

` I also tried just pasting the refresh code in and that also doesn't work. When I run the code above I get this error: {"userId":1,"exception":"[object] (Tustin\Haste\Exception\ApiException(code: 0): at {myuserroute}/backend/vendor/tustin/haste/src/Http/Middleware/ResponseHandlerMiddleware.php:58)

How do I fix this? Or what am I doing wrong? Thanks PS. When using the exact same code but with the loginwithnpssotoken function it does work.

VerburgtJimmy avatar May 15 '23 11:05 VerburgtJimmy