I am using OAUTH2 authentication to import GMAIL contacts . In my code I am storing the config parameters in an array :
$clientid=; $clients
You will get the invalid_grant error if your $auth_code was already used. Authorization codes can only be used once.
invalid_grant
$auth_code