public function handle(Request $request)
{
// Fetch client_id from authenticated token.
$clientId = $this->checkClientId();
// Check resource owner credentials
$username = $this->checkUsername($request);
// Check and set scope.
$scope = $this->checkScope($request, $clientId, $username);
// Generate access_token, store to backend and set token response.
$parameters = $this->tokenTypeHandlerFactory->getTokenTypeHandler()->createAccessToken($clientId, $username, $scope);
return JsonResponse::create($parameters, 200, ['Cache-Control' => 'no-store', 'Pragma' => 'no-cache']);
}