Title: 403 error / Forbidden when accessing https://www.googleapis.com/auth/plus.profiles.read in python · Issue #337 · 1ap/google-api-python-client · GitHub
Open Graph Title: 403 error / Forbidden when accessing https://www.googleapis.com/auth/plus.profiles.read in python · Issue #337 · 1ap/google-api-python-client
X Title: 403 error / Forbidden when accessing https://www.googleapis.com/auth/plus.profiles.read in python · Issue #337 · 1ap/google-api-python-client
Description: I had a working application that pulled all users from a domain and grab the user picture from Google Plus. After few months it was giving me a "403 error / Forbidden when accessing" This is the code import httplib2 import pprint from ap...
Open Graph Description: I had a working application that pulled all users from a domain and grab the user picture from Google Plus. After few months it was giving me a "403 error / Forbidden when accessing" This is the co...
X Description: I had a working application that pulled all users from a domain and grab the user picture from Google Plus. After few months it was giving me a "403 error / Forbidden when accessing" This...
Opengraph URL: https://github.com/1ap/google-api-python-client/issues/337
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"403 error / Forbidden when accessing https://www.googleapis.com/auth/plus.profiles.read in python","articleBody":"```\nI had a working application that pulled all users from a domain and grab the \nuser picture from Google Plus. After few months it was giving me a \"403 error / \nForbidden when accessing\"\n\nThis is the code\n\nimport httplib2\nimport pprint\n\nfrom apiclient.discovery import build\n\nfrom oauth2client.client import SignedJwtAssertionCredentials\n\nSERVICE_ACCOUNT_EMAIL = 'xxxx@developer.gserviceaccount.com'\nSERVICE_ACCOUNT_PKCS12_FILE_PATH = '/xxxx/privatekey.pem'\nUSER_EMAIL = 'xyz@test.com'\n\nSCOPES = ['https://www.googleapis.com/auth/plus.profiles.read']\n\ndef authenticate():\n print \"opening the key\"\n f = open(SERVICE_ACCOUNT_PKCS12_FILE_PATH, 'rb')\n key = f.read()\n f.close()\n print \"closing the key\"\n\n credentials = SignedJwtAssertionCredentials(SERVICE_ACCOUNT_EMAIL, key, scope=SCOPES, sub=USER_EMAIL)\n http = httplib2.Http()\n http = credentials.authorize(http)\n\n print \"getting the credentials\"\n return build('plusDomains', 'v1', http=http)\n\nprint \"calling the authentication\"\nservice = authenticate()\n\nprint \"calling people service\"\npeople_service = service.people()\n\nprint \"getting the user profile\"\npeople_document = people_service.get(userId='abc@test.com').execute()\n\nprint 'ID: %s' % people_document.get('id')\nprint 'Display name: %s' % people_document.get('displayName')\nprint 'Image URL: %s' % people_document.get('image').get('url')\nprint 'Profile URL: %s' % people_document.get('url')\n\n\nThis is the output:\ncalling the authentication\nopening the key\nclosing the key\ngetting the credentials\ncalling people service\ngetting the user profile\nTraceback (most recent call last):\n File \"test.py\", line 39, in \u003cmodule\u003e\n people_document = people_service.get(userId='abc@test.com').execute()\n File \"/usr/local/lib/python2.7/dist-packages/oauth2client/util.py\", line 132, in positional_wrapper\n return wrapped(*args, **kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/apiclient/http.py\", line 723, in execute\n raise HttpError(resp, content, uri=self.uri)\napiclient.errors.HttpError: \u003cHttpError 403 when requesting \nhttps://www.googleapis.com/plusDomains/v1/people/abc@test.com?alt=json returned \n\"Forbidden\"\u003e\n\nBy the way this is the scopes I have in the Google's CPANEL\n\nhttps://www.googleapis.com/auth/admin.directory.user.readonly\nhttps://www.googleapis.com/auth/plus.profiles.read\n\n\nHere is the link to the stackoverflow question: \nhttp://stackoverflow.com/questions/25857123/403-error-forbidden-when-accessing-h\nttps-www-googleapis-com-auth-plus-profil\n```\n\nOriginal issue reported on code.google.com by `adinno...@conservation.org` on 23 Sep 2014 at 6:10\n","author":{"url":"https://github.com/GoogleCodeExporter","@type":"Person","name":"GoogleCodeExporter"},"datePublished":"2016-03-28T19:47:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/337/google-api-python-client/issues/337"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2b64b3d3-ef23-2f4a-d288-df6e619f8da1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D0A2:1D7F:178609:1DD5FD:697D451D |
| html-safe-nonce | 653ed529a108f662823cac2d0800b1b4daf5efa56704d51c486671d618021fc4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMEEyOjFEN0Y6MTc4NjA5OjFERDVGRDo2OTdENDUxRCIsInZpc2l0b3JfaWQiOiI4MjY3NTIwMjE5NDcwNDEwNTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 433e17725b2924beffb53a4d328495d61d7ee805ed26449b1cd9a4b4d80b5bc9 |
| hovercard-subject-tag | issue:144065908 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/1ap/google-api-python-client/337/issue_layout |
| twitter:image | https://opengraph.githubassets.com/52184d78c66843b39a6b97243022b1419bbdf87f9dd710e07f838f5e8a7326eb/1ap/google-api-python-client/issues/337 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/52184d78c66843b39a6b97243022b1419bbdf87f9dd710e07f838f5e8a7326eb/1ap/google-api-python-client/issues/337 |
| og:image:alt | I had a working application that pulled all users from a domain and grab the user picture from Google Plus. After few months it was giving me a "403 error / Forbidden when accessing" This is the co... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | GoogleCodeExporter |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/1ap/google-api-python-client git https://github.com/1ap/google-api-python-client.git |
| octolytics-dimension-user_id | 12863663 |
| octolytics-dimension-user_login | 1ap |
| octolytics-dimension-repository_id | 54918735 |
| octolytics-dimension-repository_nwo | 1ap/google-api-python-client |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 54918735 |
| octolytics-dimension-repository_network_root_nwo | 1ap/google-api-python-client |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width