public function ResourceServer::validateAuthenticatedRequest in Simple OAuth (OAuth2) & OpenID Connect 8.3
Same name and namespace in other branches
- 8.4 src/Server/ResourceServer.php \Drupal\simple_oauth\Server\ResourceServer::validateAuthenticatedRequest()
- 8.2 src/Server/ResourceServer.php \Drupal\simple_oauth\Server\ResourceServer::validateAuthenticatedRequest()
- 5.x src/Server/ResourceServer.php \Drupal\simple_oauth\Server\ResourceServer::validateAuthenticatedRequest()
Determine the access token validity.
Parameters
\Symfony\Component\HttpFoundation\Request $request: The request object.
Return value
\Symfony\Component\HttpFoundation\Request The request object augmented with the token information.
Throws
\League\OAuth2\Server\Exception\OAuthServerException
Overrides ResourceServerInterface::validateAuthenticatedRequest
File
- src/
Server/ ResourceServer.php, line 58
Class
Namespace
Drupal\simple_oauth\ServerCode
public function validateAuthenticatedRequest(Request $request) {
// Create a PSR-7 message from the request that is compatible with the OAuth
// library.
$psr7_request = $this->messageFactory
->createRequest($request);
// Augment the request with the access token's decoded data or throw an
// exception if authentication is unsuccessful.
$output_psr7_request = $this->subject
->validateAuthenticatedRequest($psr7_request);
// Convert back to the Drupal/Symfony HttpFoundation objects.
return $this->foundationFactory
->createRequest($output_psr7_request);
}