The major purpose of this article is to know the security requirements and their solutions in grid and cloud computing environments. We first focused generally on the security issue in grids as in cloud computing where we examined all the articles proposed in the literature. Then, we classify them according to the treated security issue (authentication, access control, integrity, confidentiality or multiple security issues). A comparative study was carried out between the different techniques presented in each class of each environment. The same classification is done with research articles concerning security issues in cloud computing environment. The study was followed by a comparison between the different proposed techniques for each class in grid computing with those proposed within the same class in cloud. As a result we found that the access control issue is the most considered research area in both grid and cloud computing environments.