Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The resource owner or authorization server denied the request. laravel passport

The resource owner or authorization server denied the request. {"exception":"[object] (League\OAuth2\Server\Exception\OAuthServerException(code: 9)

I am experiencing this error when I'm refunding in a stripe app.

It says that the token has been revoked.

How can I solve this?

like image 642
Unwellee Avatar asked Apr 02 '26 20:04

Unwellee


1 Answers

You can prevent this Exception as it is recommended in this laracast discussion.

Override and add below condition to report() method of Handler class.

\App\Exception\Handler

public function report(Exception $exception)
{
    if ($exception instanceof \League\OAuth2\Server\Exception\OAuthServerException && $exception->getCode() == 9) {
        return;
    }
    parent::report($exception);
}
like image 73
BABAK ASHRAFI Avatar answered Apr 04 '26 08:04

BABAK ASHRAFI



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!