diff --git a/src/Grant/AuthCodeGrant.php b/src/Grant/AuthCodeGrant.php index 5f736709..aba20aea 100644 --- a/src/Grant/AuthCodeGrant.php +++ b/src/Grant/AuthCodeGrant.php @@ -335,7 +335,12 @@ class AuthCodeGrant extends AbstractAuthorizeGrant // The user denied the client, redirect them back with an error throw OAuthServerException::accessDenied( 'The user denied the request', - $finalRedirectUri + $this->makeRedirectUri( + $finalRedirectUri, + [ + 'state' => $authorizationRequest->getState(), + ] + ) ); } } diff --git a/src/Grant/ImplicitGrant.php b/src/Grant/ImplicitGrant.php index 976acefb..6f415164 100644 --- a/src/Grant/ImplicitGrant.php +++ b/src/Grant/ImplicitGrant.php @@ -207,7 +207,12 @@ class ImplicitGrant extends AbstractAuthorizeGrant // The user denied the client, redirect them back with an error throw OAuthServerException::accessDenied( 'The user denied the request', - $finalRedirectUri + $this->makeRedirectUri( + $finalRedirectUri, + [ + 'state' => $authorizationRequest->getState(), + ] + ) ); } }