{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/autorest/pulls/comments/64440597","id":64440597,"diff_hunk":"@@ -216,7 +228,70 @@ def clear_cached_token(self):\n             raise_with_traceback(KeyError, \"Unable to clear token.\")\n \n \n-class UserPassCredentials(OAuthTokenAuthentication, AADMixin):\n+class AADRefreshMixin(object):\n+    \"\"\"\n+    Additional token refresh logic\n+    \"\"\"\n+\n+    def refresh_session(self):\n+        \"\"\"Return updated session if token has expired, attempts to\n+        refresh using newly acquired token.\n+\n+        :rtype: requests.Session.\n+        \"\"\"\n+        if self.token.get('refresh_token'):\n+            try:\n+                return self.signed_session()\n+            except Expired:\n+                pass\n+        self.set_token()\n+        return self.signed_session()\n+\n+\n+class AADTokenCredentials(AADMixin):\n+    \"\"\"\n+    Credentials objects for AAD token retrieved through external process\n+    e.g. Python ADAL lib.\n+\n+    Optional kwargs may include:\n+    - china (bool): Configure auth for China-based service,","path":"ClientRuntimes/Python/msrestazure/msrestazure/azure_active_directory.py","position":74,"original_position":74,"commit_id":"9f11d41fc85cd78c42bfe255ee3891d7ac671584","original_commit_id":"9f11d41fc85cd78c42bfe255ee3891d7ac671584","user":{"login":"amarzavery","id":4521223,"avatar_url":"https://avatars.githubusercontent.com/u/4521223?v=3","gravatar_id":"","url":"https://api.github.com/users/amarzavery","html_url":"https://github.com/amarzavery","followers_url":"https://api.github.com/users/amarzavery/followers","following_url":"https://api.github.com/users/amarzavery/following{/other_user}","gists_url":"https://api.github.com/users/amarzavery/gists{/gist_id}","starred_url":"https://api.github.com/users/amarzavery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amarzavery/subscriptions","organizations_url":"https://api.github.com/users/amarzavery/orgs","repos_url":"https://api.github.com/users/amarzavery/repos","events_url":"https://api.github.com/users/amarzavery/events{/privacy}","received_events_url":"https://api.github.com/users/amarzavery/received_events","type":"User","site_admin":false},"body":"Later, the python CLI can just call these wrapper methods.  So the grunt work remains in one central place and users of python sdk and CLI both benefit from this.","created_at":"2016-05-24T17:45:49Z","updated_at":"2016-05-24T17:45:49Z","html_url":"https://github.com/Azure/autorest/pull/1078#discussion_r64440597","pull_request_url":"https://api.github.com/repos/Azure/autorest/pulls/1078","_links":{"self":{"href":"https://api.github.com/repos/Azure/autorest/pulls/comments/64440597"},"html":{"href":"https://github.com/Azure/autorest/pull/1078#discussion_r64440597"},"pull_request":{"href":"https://api.github.com/repos/Azure/autorest/pulls/1078"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/autorest/pulls/1078","id":71257871,"html_url":"https://github.com/Azure/autorest/pull/1078","diff_url":"https://github.com/Azure/autorest/pull/1078.diff","patch_url":"https://github.com/Azure/autorest/pull/1078.patch","issue_url":"https://api.github.com/repos/Azure/autorest/issues/1078","number":1078,"state":"open","locked":false,"title":"[Python] LRO and AAD updates and fixes","user":{"login":"annatisch","id":8689453,"avatar_url":"https://avatars.githubusercontent.com/u/8689453?v=3","gravatar_id":"","url":"https://api.github.com/users/annatisch","html_url":"https://github.com/annatisch","followers_url":"https://api.github.com/users/annatisch/followers","following_url":"https://api.github.com/users/annatisch/following{/other_user}","gists_url":"https://api.github.com/users/annatisch/gists{/gist_id}","starred_url":"https://api.github.com/users/annatisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annatisch/subscriptions","organizations_url":"https://api.github.com/users/annatisch/orgs","repos_url":"https://api.github.com/users/annatisch/repos","events_url":"https://api.github.com/users/annatisch/events{/privacy}","received_events_url":"https://api.github.com/users/annatisch/received_events","type":"User","site_admin":false},"body":"- Fix for several AAD issues in #1055 \r\n- Fix for LRO PATCH bug and refactor #993 ","created_at":"2016-05-24T17:08:56Z","updated_at":"2016-05-24T17:45:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"075333137c68113d2fa0d13a3acd3b4a8af30606","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Azure/autorest/pulls/1078/commits","review_comments_url":"https://api.github.com/repos/Azure/autorest/pulls/1078/comments","review_comment_url":"https://api.github.com/repos/Azure/autorest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/autorest/issues/1078/comments","statuses_url":"https://api.github.com/repos/Azure/autorest/statuses/9f11d41fc85cd78c42bfe255ee3891d7ac671584","head":{"label":"annatisch:py-dev","ref":"py-dev","sha":"9f11d41fc85cd78c42bfe255ee3891d7ac671584","user":{"login":"annatisch","id":8689453,"avatar_url":"https://avatars.githubusercontent.com/u/8689453?v=3","gravatar_id":"","url":"https://api.github.com/users/annatisch","html_url":"https://github.com/annatisch","followers_url":"https://api.github.com/users/annatisch/followers","following_url":"https://api.github.com/users/annatisch/following{/other_user}","gists_url":"https://api.github.com/users/annatisch/gists{/gist_id}","starred_url":"https://api.github.com/users/annatisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annatisch/subscriptions","organizations_url":"https://api.github.com/users/annatisch/orgs","repos_url":"https://api.github.com/users/annatisch/repos","events_url":"https://api.github.com/users/annatisch/events{/privacy}","received_events_url":"https://api.github.com/users/annatisch/received_events","type":"User","site_admin":false},"repo":{"id":54414945,"name":"autorest","full_name":"annatisch/autorest","owner":{"login":"annatisch","id":8689453,"avatar_url":"https://avatars.githubusercontent.com/u/8689453?v=3","gravatar_id":"","url":"https://api.github.com/users/annatisch","html_url":"https://github.com/annatisch","followers_url":"https://api.github.com/users/annatisch/followers","following_url":"https://api.github.com/users/annatisch/following{/other_user}","gists_url":"https://api.github.com/users/annatisch/gists{/gist_id}","starred_url":"https://api.github.com/users/annatisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annatisch/subscriptions","organizations_url":"https://api.github.com/users/annatisch/orgs","repos_url":"https://api.github.com/users/annatisch/repos","events_url":"https://api.github.com/users/annatisch/events{/privacy}","received_events_url":"https://api.github.com/users/annatisch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/annatisch/autorest","description":"","fork":true,"url":"https://api.github.com/repos/annatisch/autorest","forks_url":"https://api.github.com/repos/annatisch/autorest/forks","keys_url":"https://api.github.com/repos/annatisch/autorest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/annatisch/autorest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/annatisch/autorest/teams","hooks_url":"https://api.github.com/repos/annatisch/autorest/hooks","issue_events_url":"https://api.github.com/repos/annatisch/autorest/issues/events{/number}","events_url":"https://api.github.com/repos/annatisch/autorest/events","assignees_url":"https://api.github.com/repos/annatisch/autorest/assignees{/user}","branches_url":"https://api.github.com/repos/annatisch/autorest/branches{/branch}","tags_url":"https://api.github.com/repos/annatisch/autorest/tags","blobs_url":"https://api.github.com/repos/annatisch/autorest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/annatisch/autorest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/annatisch/autorest/git/refs{/sha}","trees_url":"https://api.github.com/repos/annatisch/autorest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/annatisch/autorest/statuses/{sha}","languages_url":"https://api.github.com/repos/annatisch/autorest/languages","stargazers_url":"https://api.github.com/repos/annatisch/autorest/stargazers","contributors_url":"https://api.github.com/repos/annatisch/autorest/contributors","subscribers_url":"https://api.github.com/repos/annatisch/autorest/subscribers","subscription_url":"https://api.github.com/repos/annatisch/autorest/subscription","commits_url":"https://api.github.com/repos/annatisch/autorest/commits{/sha}","git_commits_url":"https://api.github.com/repos/annatisch/autorest/git/commits{/sha}","comments_url":"https://api.github.com/repos/annatisch/autorest/comments{/number}","issue_comment_url":"https://api.github.com/repos/annatisch/autorest/issues/comments{/number}","contents_url":"https://api.github.com/repos/annatisch/autorest/contents/{+path}","compare_url":"https://api.github.com/repos/annatisch/autorest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/annatisch/autorest/merges","archive_url":"https://api.github.com/repos/annatisch/autorest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/annatisch/autorest/downloads","issues_url":"https://api.github.com/repos/annatisch/autorest/issues{/number}","pulls_url":"https://api.github.com/repos/annatisch/autorest/pulls{/number}","milestones_url":"https://api.github.com/repos/annatisch/autorest/milestones{/number}","notifications_url":"https://api.github.com/repos/annatisch/autorest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/annatisch/autorest/labels{/name}","releases_url":"https://api.github.com/repos/annatisch/autorest/releases{/id}","deployments_url":"https://api.github.com/repos/annatisch/autorest/deployments","created_at":"2016-03-21T18:59:00Z","updated_at":"2016-03-21T18:59:07Z","pushed_at":"2016-05-24T17:04:51Z","git_url":"git://github.com/annatisch/autorest.git","ssh_url":"git@github.com:annatisch/autorest.git","clone_url":"https://github.com/annatisch/autorest.git","svn_url":"https://github.com/annatisch/autorest","homepage":null,"size":43365,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"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":"Azure:master","ref":"master","sha":"f1f7584ad253feb05c51621dbf96df66001db323","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":31089461,"name":"autorest","full_name":"Azure/autorest","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/autorest","description":"","fork":false,"url":"https://api.github.com/repos/Azure/autorest","forks_url":"https://api.github.com/repos/Azure/autorest/forks","keys_url":"https://api.github.com/repos/Azure/autorest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/autorest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/autorest/teams","hooks_url":"https://api.github.com/repos/Azure/autorest/hooks","issue_events_url":"https://api.github.com/repos/Azure/autorest/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/autorest/events","assignees_url":"https://api.github.com/repos/Azure/autorest/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/autorest/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/autorest/tags","blobs_url":"https://api.github.com/repos/Azure/autorest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/autorest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/autorest/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/autorest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/autorest/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/autorest/languages","stargazers_url":"https://api.github.com/repos/Azure/autorest/stargazers","contributors_url":"https://api.github.com/repos/Azure/autorest/contributors","subscribers_url":"https://api.github.com/repos/Azure/autorest/subscribers","subscription_url":"https://api.github.com/repos/Azure/autorest/subscription","commits_url":"https://api.github.com/repos/Azure/autorest/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/autorest/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/autorest/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/autorest/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/autorest/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/autorest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/autorest/merges","archive_url":"https://api.github.com/repos/Azure/autorest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/autorest/downloads","issues_url":"https://api.github.com/repos/Azure/autorest/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/autorest/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/autorest/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/autorest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/autorest/labels{/name}","releases_url":"https://api.github.com/repos/Azure/autorest/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/autorest/deployments","created_at":"2015-02-20T23:02:54Z","updated_at":"2016-05-24T17:18:29Z","pushed_at":"2016-05-24T17:43:11Z","git_url":"git://github.com/Azure/autorest.git","ssh_url":"git@github.com:Azure/autorest.git","clone_url":"https://github.com/Azure/autorest.git","svn_url":"https://github.com/Azure/autorest","homepage":null,"size":49229,"stargazers_count":378,"watchers_count":378,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":135,"mirror_url":null,"open_issues_count":124,"forks":135,"open_issues":124,"watchers":378,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/autorest/pulls/1078"},"html":{"href":"https://github.com/Azure/autorest/pull/1078"},"issue":{"href":"https://api.github.com/repos/Azure/autorest/issues/1078"},"comments":{"href":"https://api.github.com/repos/Azure/autorest/issues/1078/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/autorest/pulls/1078/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/autorest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/autorest/pulls/1078/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/autorest/statuses/9f11d41fc85cd78c42bfe255ee3891d7ac671584"}}}}
{"actor":{"display_login":"amarzavery"}}