{"action":"created","comment":{"url":"https://api.github.com/repos/google/google-api-dotnet-client/pulls/comments/36525738","id":36525738,"diff_hunk":"@@ -22,19 +22,24 @@\n namespace Google.Apis.Auth.OAuth2\n {\n     /// <summary>","path":"Src/GoogleApis.Auth/OAuth2/ITokenAccess.cs","position":3,"original_position":3,"commit_id":"fb2371d20222ec9a3536a9062c24e19d0f21f156","original_commit_id":"fb2371d20222ec9a3536a9062c24e19d0f21f156","user":{"login":"peleyal","id":3082873,"avatar_url":"https://avatars.githubusercontent.com/u/3082873?v=3","gravatar_id":"","url":"https://api.github.com/users/peleyal","html_url":"https://github.com/peleyal","followers_url":"https://api.github.com/users/peleyal/followers","following_url":"https://api.github.com/users/peleyal/following{/other_user}","gists_url":"https://api.github.com/users/peleyal/gists{/gist_id}","starred_url":"https://api.github.com/users/peleyal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peleyal/subscriptions","organizations_url":"https://api.github.com/users/peleyal/orgs","repos_url":"https://api.github.com/users/peleyal/repos","events_url":"https://api.github.com/users/peleyal/events{/privacy}","received_events_url":"https://api.github.com/users/peleyal/received_events","type":"User","site_admin":false},"body":"IMPORTANT!!!!\r\nThis interface should be in the Google.Apis.Auth and not in the DotNet4 project.\r\nI didn't notice that before. My bad...","created_at":"2015-08-07T14:46:55Z","updated_at":"2015-08-07T14:46:55Z","html_url":"https://github.com/google/google-api-dotnet-client/pull/572#discussion_r36525738","pull_request_url":"https://api.github.com/repos/google/google-api-dotnet-client/pulls/572","_links":{"self":{"href":"https://api.github.com/repos/google/google-api-dotnet-client/pulls/comments/36525738"},"html":{"href":"https://github.com/google/google-api-dotnet-client/pull/572#discussion_r36525738"},"pull_request":{"href":"https://api.github.com/repos/google/google-api-dotnet-client/pulls/572"}}},"pull_request":{"url":"https://api.github.com/repos/google/google-api-dotnet-client/pulls/572","id":41852255,"html_url":"https://github.com/google/google-api-dotnet-client/pull/572","diff_url":"https://github.com/google/google-api-dotnet-client/pull/572.diff","patch_url":"https://github.com/google/google-api-dotnet-client/pull/572.patch","issue_url":"https://api.github.com/repos/google/google-api-dotnet-client/issues/572","number":572,"state":"open","locked":false,"title":"Add JWT access token support.","user":{"login":"jtattermusch","id":9939684,"avatar_url":"https://avatars.githubusercontent.com/u/9939684?v=3","gravatar_id":"","url":"https://api.github.com/users/jtattermusch","html_url":"https://github.com/jtattermusch","followers_url":"https://api.github.com/users/jtattermusch/followers","following_url":"https://api.github.com/users/jtattermusch/following{/other_user}","gists_url":"https://api.github.com/users/jtattermusch/gists{/gist_id}","starred_url":"https://api.github.com/users/jtattermusch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtattermusch/subscriptions","organizations_url":"https://api.github.com/users/jtattermusch/orgs","repos_url":"https://api.github.com/users/jtattermusch/repos","events_url":"https://api.github.com/users/jtattermusch/events{/privacy}","received_events_url":"https://api.github.com/users/jtattermusch/received_events","type":"User","site_admin":false},"body":"This adds support for JWT access tokens to a special flavor of ServiceAccountCredential (named JwtServiceAccountCredential). This allows users to use JWT access tokens to authenticate with a service either directly (by using JwtServiceAccountCredential) or through Application Default Credentials stack.\r\n\r\nthe JwtServiceAccountCredential  works in two modes:\r\n-- if you don't add any scopes to it, it uses JWT access tokens to authenticate the requests.\r\n-- once scopes are added, the behavior falls back to exactly what ServiceAccountCredential does.\r\n\r\nIf you are using GoogleCredentials, and IsCreateScopedRequired is true (no scopes present), you'll get the JWT access token behavior. After calling CreateScoped(), you'll get the old ServiceAccountCredential behavior. This is consistent to what implementations in other languages are doing (google nodeJS auth library for example).\r\n\r\nA few remarks on the changes I've made:\r\n-- a bit of refactoring in ServiceCredential, ServiceAccountCredential and UserCredential to expose ITokenAccess interface directly (which addresses one of the TODOs we've had)\r\n-- the ITokenAccess has changed and now contains method GetAccessTokenForRequestAsync() which accepts auth URI parameter (required for JWT access token support).\r\n-- stripped lots of code from GoogleCredential, thanks to the interface changes I've made.\r\n-- semantics of ServiceAccountCredential is fully preserved so users shouldn't notice any change.","created_at":"2015-08-07T01:31:09Z","updated_at":"2015-08-07T14:46:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d3a1b566f529d37b24ba9c084745c09fb2221848","assignee":{"login":"peleyal","id":3082873,"avatar_url":"https://avatars.githubusercontent.com/u/3082873?v=3","gravatar_id":"","url":"https://api.github.com/users/peleyal","html_url":"https://github.com/peleyal","followers_url":"https://api.github.com/users/peleyal/followers","following_url":"https://api.github.com/users/peleyal/following{/other_user}","gists_url":"https://api.github.com/users/peleyal/gists{/gist_id}","starred_url":"https://api.github.com/users/peleyal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peleyal/subscriptions","organizations_url":"https://api.github.com/users/peleyal/orgs","repos_url":"https://api.github.com/users/peleyal/repos","events_url":"https://api.github.com/users/peleyal/events{/privacy}","received_events_url":"https://api.github.com/users/peleyal/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/google/google-api-dotnet-client/pulls/572/commits","review_comments_url":"https://api.github.com/repos/google/google-api-dotnet-client/pulls/572/comments","review_comment_url":"https://api.github.com/repos/google/google-api-dotnet-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/google-api-dotnet-client/issues/572/comments","statuses_url":"https://api.github.com/repos/google/google-api-dotnet-client/statuses/fb2371d20222ec9a3536a9062c24e19d0f21f156","head":{"label":"jtattermusch:jwt_access_token","ref":"jwt_access_token","sha":"fb2371d20222ec9a3536a9062c24e19d0f21f156","user":{"login":"jtattermusch","id":9939684,"avatar_url":"https://avatars.githubusercontent.com/u/9939684?v=3","gravatar_id":"","url":"https://api.github.com/users/jtattermusch","html_url":"https://github.com/jtattermusch","followers_url":"https://api.github.com/users/jtattermusch/followers","following_url":"https://api.github.com/users/jtattermusch/following{/other_user}","gists_url":"https://api.github.com/users/jtattermusch/gists{/gist_id}","starred_url":"https://api.github.com/users/jtattermusch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtattermusch/subscriptions","organizations_url":"https://api.github.com/users/jtattermusch/orgs","repos_url":"https://api.github.com/users/jtattermusch/repos","events_url":"https://api.github.com/users/jtattermusch/events{/privacy}","received_events_url":"https://api.github.com/users/jtattermusch/received_events","type":"User","site_admin":false},"repo":{"id":38863126,"name":"google-api-dotnet-client","full_name":"jtattermusch/google-api-dotnet-client","owner":{"login":"jtattermusch","id":9939684,"avatar_url":"https://avatars.githubusercontent.com/u/9939684?v=3","gravatar_id":"","url":"https://api.github.com/users/jtattermusch","html_url":"https://github.com/jtattermusch","followers_url":"https://api.github.com/users/jtattermusch/followers","following_url":"https://api.github.com/users/jtattermusch/following{/other_user}","gists_url":"https://api.github.com/users/jtattermusch/gists{/gist_id}","starred_url":"https://api.github.com/users/jtattermusch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtattermusch/subscriptions","organizations_url":"https://api.github.com/users/jtattermusch/orgs","repos_url":"https://api.github.com/users/jtattermusch/repos","events_url":"https://api.github.com/users/jtattermusch/events{/privacy}","received_events_url":"https://api.github.com/users/jtattermusch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jtattermusch/google-api-dotnet-client","description":"Google APIs Client Library for .NET","fork":true,"url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client","forks_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/forks","keys_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/teams","hooks_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/hooks","issue_events_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/issues/events{/number}","events_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/events","assignees_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/assignees{/user}","branches_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/branches{/branch}","tags_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/tags","blobs_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/statuses/{sha}","languages_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/languages","stargazers_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/stargazers","contributors_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/contributors","subscribers_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/subscribers","subscription_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/subscription","commits_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/contents/{+path}","compare_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/merges","archive_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/downloads","issues_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/issues{/number}","pulls_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/pulls{/number}","milestones_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/milestones{/number}","notifications_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/labels{/name}","releases_url":"https://api.github.com/repos/jtattermusch/google-api-dotnet-client/releases{/id}","created_at":"2015-07-10T05:41:46Z","updated_at":"2015-07-10T05:41:47Z","pushed_at":"2015-08-07T02:49:51Z","git_url":"git://github.com/jtattermusch/google-api-dotnet-client.git","ssh_url":"git@github.com:jtattermusch/google-api-dotnet-client.git","clone_url":"https://github.com/jtattermusch/google-api-dotnet-client.git","svn_url":"https://github.com/jtattermusch/google-api-dotnet-client","homepage":"https://developers.google.com/api-client-library/dotnet","size":8857,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"3b8ec7c9d39ac3460e4b887c5494cac6f1ac529c","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":33947900,"name":"google-api-dotnet-client","full_name":"google/google-api-dotnet-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/google-api-dotnet-client","description":"Google APIs Client Library for .NET","fork":false,"url":"https://api.github.com/repos/google/google-api-dotnet-client","forks_url":"https://api.github.com/repos/google/google-api-dotnet-client/forks","keys_url":"https://api.github.com/repos/google/google-api-dotnet-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/google-api-dotnet-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/google-api-dotnet-client/teams","hooks_url":"https://api.github.com/repos/google/google-api-dotnet-client/hooks","issue_events_url":"https://api.github.com/repos/google/google-api-dotnet-client/issues/events{/number}","events_url":"https://api.github.com/repos/google/google-api-dotnet-client/events","assignees_url":"https://api.github.com/repos/google/google-api-dotnet-client/assignees{/user}","branches_url":"https://api.github.com/repos/google/google-api-dotnet-client/branches{/branch}","tags_url":"https://api.github.com/repos/google/google-api-dotnet-client/tags","blobs_url":"https://api.github.com/repos/google/google-api-dotnet-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/google-api-dotnet-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/google-api-dotnet-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/google-api-dotnet-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/google-api-dotnet-client/statuses/{sha}","languages_url":"https://api.github.com/repos/google/google-api-dotnet-client/languages","stargazers_url":"https://api.github.com/repos/google/google-api-dotnet-client/stargazers","contributors_url":"https://api.github.com/repos/google/google-api-dotnet-client/contributors","subscribers_url":"https://api.github.com/repos/google/google-api-dotnet-client/subscribers","subscription_url":"https://api.github.com/repos/google/google-api-dotnet-client/subscription","commits_url":"https://api.github.com/repos/google/google-api-dotnet-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/google-api-dotnet-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/google-api-dotnet-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/google-api-dotnet-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/google-api-dotnet-client/contents/{+path}","compare_url":"https://api.github.com/repos/google/google-api-dotnet-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/google-api-dotnet-client/merges","archive_url":"https://api.github.com/repos/google/google-api-dotnet-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/google-api-dotnet-client/downloads","issues_url":"https://api.github.com/repos/google/google-api-dotnet-client/issues{/number}","pulls_url":"https://api.github.com/repos/google/google-api-dotnet-client/pulls{/number}","milestones_url":"https://api.github.com/repos/google/google-api-dotnet-client/milestones{/number}","notifications_url":"https://api.github.com/repos/google/google-api-dotnet-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/google-api-dotnet-client/labels{/name}","releases_url":"https://api.github.com/repos/google/google-api-dotnet-client/releases{/id}","created_at":"2015-04-14T17:56:22Z","updated_at":"2015-08-06T15:27:38Z","pushed_at":"2015-08-07T02:49:51Z","git_url":"git://github.com/google/google-api-dotnet-client.git","ssh_url":"git@github.com:google/google-api-dotnet-client.git","clone_url":"https://github.com/google/google-api-dotnet-client.git","svn_url":"https://github.com/google/google-api-dotnet-client","homepage":"https://developers.google.com/api-client-library/dotnet","size":12680,"stargazers_count":54,"watchers_count":54,"language":"C#","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":97,"forks":28,"open_issues":97,"watchers":54,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/google-api-dotnet-client/pulls/572"},"html":{"href":"https://github.com/google/google-api-dotnet-client/pull/572"},"issue":{"href":"https://api.github.com/repos/google/google-api-dotnet-client/issues/572"},"comments":{"href":"https://api.github.com/repos/google/google-api-dotnet-client/issues/572/comments"},"review_comments":{"href":"https://api.github.com/repos/google/google-api-dotnet-client/pulls/572/comments"},"review_comment":{"href":"https://api.github.com/repos/google/google-api-dotnet-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/google-api-dotnet-client/pulls/572/commits"},"statuses":{"href":"https://api.github.com/repos/google/google-api-dotnet-client/statuses/fb2371d20222ec9a3536a9062c24e19d0f21f156"}}}}