{"action":"created","issue":{"url":"https://api.github.com/repos/google/oauth2client/issues/193","labels_url":"https://api.github.com/repos/google/oauth2client/issues/193/labels{/name}","comments_url":"https://api.github.com/repos/google/oauth2client/issues/193/comments","events_url":"https://api.github.com/repos/google/oauth2client/issues/193/events","html_url":"https://github.com/google/oauth2client/issues/193","id":83620197,"number":193,"title":"Service Account authentication fails on Linux, works on Mac OS X","user":{"login":"migurski","id":58730,"avatar_url":"https://avatars.githubusercontent.com/u/58730?v=3","gravatar_id":"","url":"https://api.github.com/users/migurski","html_url":"https://github.com/migurski","followers_url":"https://api.github.com/users/migurski/followers","following_url":"https://api.github.com/users/migurski/following{/other_user}","gists_url":"https://api.github.com/users/migurski/gists{/gist_id}","starred_url":"https://api.github.com/users/migurski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/migurski/subscriptions","organizations_url":"https://api.github.com/users/migurski/orgs","repos_url":"https://api.github.com/users/migurski/repos","events_url":"https://api.github.com/users/migurski/events{/privacy}","received_events_url":"https://api.github.com/users/migurski/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-06-01T17:46:46Z","updated_at":"2015-06-23T19:35:01Z","closed_at":"2015-06-09T19:02:55Z","body":"I am using gspread 0.2.5 and oauth2client 1.4.11. On a Mac with Python 2.7.5 I can authenticate to Google and retrieve data using this code:\r\n\r\n```python\r\nfrom oauth2client.client import SignedJwtAssertionCredentials\r\nscopes = ['https://spreadsheets.google.com/feeds/', 'https://docs.google.com/feeds']\r\ncredentials = SignedJwtAssertionCredentials(client_email, private_key, scopes)\r\ngc = gspread.authorize(credentials)\r\n```\r\n\r\nOn Ubuntu 14.04 Linux with Python 2.7.6 and identical credentials, I see this error:\r\n\r\n```python\r\nTraceback (most recent call last):\r\n  File \"scripts/website-people-update.py\", line 76, in <module>\r\n    sheets = load_sheets(gdocs_client_email, gdocs_private_key)\r\n  File \"scripts/website-people-update.py\", line 25, in load_sheets\r\n    gc = gspread.authorize(credentials)\r\n  File \"/usr/local/lib/python2.7/dist-packages/gspread/client.py\", line 335, in authorize\r\n    client.login()\r\n  File \"/usr/local/lib/python2.7/dist-packages/gspread/client.py\", line 98, in login\r\n    self.auth.refresh(http)\r\n  File \"/usr/local/lib/python2.7/dist-packages/oauth2client/client.py\", line 598, in refresh\r\n    self._refresh(http.request)\r\n  File \"/usr/local/lib/python2.7/dist-packages/oauth2client/client.py\", line 769, in _refresh\r\n    self._do_refresh_request(http_request)\r\n  File \"/usr/local/lib/python2.7/dist-packages/oauth2client/client.py\", line 834, in _do_refresh_request\r\n    raise AccessTokenRefreshError(error_msg)\r\nAccessTokenRefreshError: invalid_grant\r\n```\r\n\r\nI’m at a bit of a loss. Searches for `invalid_grant` come up with solutions that address incorrect configuration, rather than platform-specific failure."},"comment":{"url":"https://api.github.com/repos/google/oauth2client/issues/comments/114618536","html_url":"https://github.com/google/oauth2client/issues/193#issuecomment-114618536","issue_url":"https://api.github.com/repos/google/oauth2client/issues/193","id":114618536,"user":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T19:35:01Z","updated_at":"2015-06-23T19:35:01Z","body":"Has an internal Google bug been filed with the identity team yet?\r\n\r\nEasy to file issue:\r\n\r\n```\r\nError message should include message about invalid timestamps.\r\n\r\nUser on a machine with clock drift received `{'error': `invalid_grant`}` and no other context when trying to get an access token for a service account. Finding the root cause (the clock drift on the machine) required digging fully into the source code of the client library to check that the payload was being signed correctly and to analyze each section of the JWT sent.\r\n\r\nSee https://github.com/google/oauth2client/issues/193.\r\n```\r\n\r\n/cc @nathanielmanistaatgoogle @anthmgoogle"}}