Tustin / psn-php

A PHP wrapper for the PSN API
https://tustin.dev/psn-php/
MIT License
358 stars 74 forks source link

Can't login with refresh token. Only with NPSSO #249

Open VerburgtJimmy opened 1 year ago

VerburgtJimmy commented 1 year ago

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.

julianolandim commented 1 year ago

I'm having the same problem :(