Login with Google Not working in the server : Login with Google using Google+ API is not working in the server, but working correctly in the localhost.

it is not redirecting to domains.php file after authentication. getting the below like URL in the browser bar.

   
    site.com/domains/domains.php?code=4%2FsrQHdwzRfgdf4isoIuxgfddgRvhgfdfg0WbQ6eV5gfyj7I8ER

Error: Fatal error: Uncaught Google_AuthException: Error fetching OAuth2 access token, message: 'invalid_grant' in /home/myjobs/public_html/domain/login_with_google/src/auth/Google_OAuth2.php

Anybody tell me the solution.