{"action":"created","comment":{"url":"https://api.github.com/repos/google/identity-toolkit-python-client/pulls/comments/46644293","id":46644293,"diff_hunk":"@@ -250,7 +266,17 @@ def VerifyGitkitToken(self, jwt):\n     certs = self.rpc_helper.GetPublicCert()\n     crypt.MAX_TOKEN_LIFETIME_SECS = 30 * 86400  # 30 days\n     try:\n-      parsed = crypt.verify_signed_jwt_with_certs(jwt, certs, self.client_id)\n+      parsed = None\n+      for aud in [self.project_id, self.client_id]:\n+        try:\n+          parsed = crypt.verify_signed_jwt_with_certs(jwt, certs, aud)\n+        except crypt.AppIdentityError as e:\n+          if \"Wrong recipient\" not in e.message:\n+            raise e\n+        if parsed:\n+          break\n+      if not parsed:\n+        raise crypt.AppIdentityError(\"Gitkit token audience doesn't match projectId or clientId in server configuration\")\n       return GitkitUser.FromToken(parsed)\n     except crypt.AppIdentityError:","path":"identitytoolkit/gitkitclient.py","position":94,"original_position":91,"commit_id":"cabe6ec5247e68d2c7b92165657d2b6ada31cdc0","original_commit_id":"1ada260a1d2adf0cf144f406cf8d7208f1b73494","user":{"login":"wyhao31","id":1921697,"avatar_url":"https://avatars.githubusercontent.com/u/1921697?v=3","gravatar_id":"","url":"https://api.github.com/users/wyhao31","html_url":"https://github.com/wyhao31","followers_url":"https://api.github.com/users/wyhao31/followers","following_url":"https://api.github.com/users/wyhao31/following{/other_user}","gists_url":"https://api.github.com/users/wyhao31/gists{/gist_id}","starred_url":"https://api.github.com/users/wyhao31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wyhao31/subscriptions","organizations_url":"https://api.github.com/users/wyhao31/orgs","repos_url":"https://api.github.com/users/wyhao31/repos","events_url":"https://api.github.com/users/wyhao31/events{/privacy}","received_events_url":"https://api.github.com/users/wyhao31/received_events","type":"User","site_admin":false},"body":"I read the <code>verify_signed_jwt_with_certs</code> code in https://github.com/google/oauth2client/blob/master/oauth2client/crypt.py#L200\r\nI think It will not return None.","created_at":"2015-12-04T02:58:11Z","updated_at":"2015-12-04T02:58:11Z","html_url":"https://github.com/google/identity-toolkit-python-client/pull/15#discussion_r46644293","pull_request_url":"https://api.github.com/repos/google/identity-toolkit-python-client/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/google/identity-toolkit-python-client/pulls/comments/46644293"},"html":{"href":"https://github.com/google/identity-toolkit-python-client/pull/15#discussion_r46644293"},"pull_request":{"href":"https://api.github.com/repos/google/identity-toolkit-python-client/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/google/identity-toolkit-python-client/pulls/15","id":52483381,"html_url":"https://github.com/google/identity-toolkit-python-client/pull/15","diff_url":"https://github.com/google/identity-toolkit-python-client/pull/15.diff","patch_url":"https://github.com/google/identity-toolkit-python-client/pull/15.patch","issue_url":"https://api.github.com/repos/google/identity-toolkit-python-client/issues/15","number":15,"state":"open","locked":false,"title":"Support clientId and/or projectId in gtoken's audience checker","user":{"login":"wyhao31","id":1921697,"avatar_url":"https://avatars.githubusercontent.com/u/1921697?v=3","gravatar_id":"","url":"https://api.github.com/users/wyhao31","html_url":"https://github.com/wyhao31","followers_url":"https://api.github.com/users/wyhao31/followers","following_url":"https://api.github.com/users/wyhao31/following{/other_user}","gists_url":"https://api.github.com/users/wyhao31/gists{/gist_id}","starred_url":"https://api.github.com/users/wyhao31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wyhao31/subscriptions","organizations_url":"https://api.github.com/users/wyhao31/orgs","repos_url":"https://api.github.com/users/wyhao31/repos","events_url":"https://api.github.com/users/wyhao31/events{/privacy}","received_events_url":"https://api.github.com/users/wyhao31/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-03T02:15:06Z","updated_at":"2015-12-04T02:58:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23e2815e8fb7b97aea6618e83d2fc7185126474f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/identity-toolkit-python-client/pulls/15/commits","review_comments_url":"https://api.github.com/repos/google/identity-toolkit-python-client/pulls/15/comments","review_comment_url":"https://api.github.com/repos/google/identity-toolkit-python-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/identity-toolkit-python-client/issues/15/comments","statuses_url":"https://api.github.com/repos/google/identity-toolkit-python-client/statuses/cabe6ec5247e68d2c7b92165657d2b6ada31cdc0","head":{"label":"wyhao31:master","ref":"master","sha":"cabe6ec5247e68d2c7b92165657d2b6ada31cdc0","user":{"login":"wyhao31","id":1921697,"avatar_url":"https://avatars.githubusercontent.com/u/1921697?v=3","gravatar_id":"","url":"https://api.github.com/users/wyhao31","html_url":"https://github.com/wyhao31","followers_url":"https://api.github.com/users/wyhao31/followers","following_url":"https://api.github.com/users/wyhao31/following{/other_user}","gists_url":"https://api.github.com/users/wyhao31/gists{/gist_id}","starred_url":"https://api.github.com/users/wyhao31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wyhao31/subscriptions","organizations_url":"https://api.github.com/users/wyhao31/orgs","repos_url":"https://api.github.com/users/wyhao31/repos","events_url":"https://api.github.com/users/wyhao31/events{/privacy}","received_events_url":"https://api.github.com/users/wyhao31/received_events","type":"User","site_admin":false},"repo":{"id":46579459,"name":"identity-toolkit-python-client","full_name":"wyhao31/identity-toolkit-python-client","owner":{"login":"wyhao31","id":1921697,"avatar_url":"https://avatars.githubusercontent.com/u/1921697?v=3","gravatar_id":"","url":"https://api.github.com/users/wyhao31","html_url":"https://github.com/wyhao31","followers_url":"https://api.github.com/users/wyhao31/followers","following_url":"https://api.github.com/users/wyhao31/following{/other_user}","gists_url":"https://api.github.com/users/wyhao31/gists{/gist_id}","starred_url":"https://api.github.com/users/wyhao31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wyhao31/subscriptions","organizations_url":"https://api.github.com/users/wyhao31/orgs","repos_url":"https://api.github.com/users/wyhao31/repos","events_url":"https://api.github.com/users/wyhao31/events{/privacy}","received_events_url":"https://api.github.com/users/wyhao31/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wyhao31/identity-toolkit-python-client","description":"Google Identity Toolkit client library for Python","fork":true,"url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client","forks_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/forks","keys_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/teams","hooks_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/hooks","issue_events_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/issues/events{/number}","events_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/events","assignees_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/assignees{/user}","branches_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/branches{/branch}","tags_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/tags","blobs_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/statuses/{sha}","languages_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/languages","stargazers_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/stargazers","contributors_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/contributors","subscribers_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/subscribers","subscription_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/subscription","commits_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/contents/{+path}","compare_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/merges","archive_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/downloads","issues_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/issues{/number}","pulls_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/pulls{/number}","milestones_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/milestones{/number}","notifications_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/labels{/name}","releases_url":"https://api.github.com/repos/wyhao31/identity-toolkit-python-client/releases{/id}","created_at":"2015-11-20T18:29:14Z","updated_at":"2015-11-20T18:29:15Z","pushed_at":"2015-12-04T00:31:18Z","git_url":"git://github.com/wyhao31/identity-toolkit-python-client.git","ssh_url":"git@github.com:wyhao31/identity-toolkit-python-client.git","clone_url":"https://github.com/wyhao31/identity-toolkit-python-client.git","svn_url":"https://github.com/wyhao31/identity-toolkit-python-client","homepage":"","size":75,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"5a9c083dba5164c785dec245bcc6447ee69094c8","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":23970023,"name":"identity-toolkit-python-client","full_name":"google/identity-toolkit-python-client","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/identity-toolkit-python-client","description":"Google Identity Toolkit client library for Python","fork":false,"url":"https://api.github.com/repos/google/identity-toolkit-python-client","forks_url":"https://api.github.com/repos/google/identity-toolkit-python-client/forks","keys_url":"https://api.github.com/repos/google/identity-toolkit-python-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/identity-toolkit-python-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/identity-toolkit-python-client/teams","hooks_url":"https://api.github.com/repos/google/identity-toolkit-python-client/hooks","issue_events_url":"https://api.github.com/repos/google/identity-toolkit-python-client/issues/events{/number}","events_url":"https://api.github.com/repos/google/identity-toolkit-python-client/events","assignees_url":"https://api.github.com/repos/google/identity-toolkit-python-client/assignees{/user}","branches_url":"https://api.github.com/repos/google/identity-toolkit-python-client/branches{/branch}","tags_url":"https://api.github.com/repos/google/identity-toolkit-python-client/tags","blobs_url":"https://api.github.com/repos/google/identity-toolkit-python-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/identity-toolkit-python-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/identity-toolkit-python-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/identity-toolkit-python-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/identity-toolkit-python-client/statuses/{sha}","languages_url":"https://api.github.com/repos/google/identity-toolkit-python-client/languages","stargazers_url":"https://api.github.com/repos/google/identity-toolkit-python-client/stargazers","contributors_url":"https://api.github.com/repos/google/identity-toolkit-python-client/contributors","subscribers_url":"https://api.github.com/repos/google/identity-toolkit-python-client/subscribers","subscription_url":"https://api.github.com/repos/google/identity-toolkit-python-client/subscription","commits_url":"https://api.github.com/repos/google/identity-toolkit-python-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/identity-toolkit-python-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/identity-toolkit-python-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/identity-toolkit-python-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/identity-toolkit-python-client/contents/{+path}","compare_url":"https://api.github.com/repos/google/identity-toolkit-python-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/identity-toolkit-python-client/merges","archive_url":"https://api.github.com/repos/google/identity-toolkit-python-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/identity-toolkit-python-client/downloads","issues_url":"https://api.github.com/repos/google/identity-toolkit-python-client/issues{/number}","pulls_url":"https://api.github.com/repos/google/identity-toolkit-python-client/pulls{/number}","milestones_url":"https://api.github.com/repos/google/identity-toolkit-python-client/milestones{/number}","notifications_url":"https://api.github.com/repos/google/identity-toolkit-python-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/identity-toolkit-python-client/labels{/name}","releases_url":"https://api.github.com/repos/google/identity-toolkit-python-client/releases{/id}","created_at":"2014-09-12T17:28:53Z","updated_at":"2015-11-30T09:52:06Z","pushed_at":"2015-12-04T00:31:19Z","git_url":"git://github.com/google/identity-toolkit-python-client.git","ssh_url":"git@github.com:google/identity-toolkit-python-client.git","clone_url":"https://github.com/google/identity-toolkit-python-client.git","svn_url":"https://github.com/google/identity-toolkit-python-client","homepage":"","size":57,"stargazers_count":15,"watchers_count":15,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":3,"forks":13,"open_issues":3,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/identity-toolkit-python-client/pulls/15"},"html":{"href":"https://github.com/google/identity-toolkit-python-client/pull/15"},"issue":{"href":"https://api.github.com/repos/google/identity-toolkit-python-client/issues/15"},"comments":{"href":"https://api.github.com/repos/google/identity-toolkit-python-client/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/google/identity-toolkit-python-client/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/google/identity-toolkit-python-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/identity-toolkit-python-client/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/google/identity-toolkit-python-client/statuses/cabe6ec5247e68d2c7b92165657d2b6ada31cdc0"}}}}