{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/msrestazure-for-python/pulls/comments/90292269","pull_request_review_id":10813717,"id":90292269,"diff_hunk":"@@ -525,3 +524,81 @@ def set_token(self, response_url):\n             raise_with_traceback(AuthenticationError, \"\", err)\n         else:\n             self.token = token\n+\n+\n+class AdalAuthentication(Authentication):  # pylint: disable=too-few-public-methods\n+    \"\"\"A wrapper to use ADAL for Python easily to authenticate on Azure.","path":"msrestazure/azure_active_directory.py","position":null,"original_position":32,"commit_id":"82532cf7a7ffb4dfbf9c8404dfa792bee70eb8ce","original_commit_id":"24d71059b14e8b2c612cce35a98bfd603a14da6a","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars.githubusercontent.com/u/1050156?v=3","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"body":"done too","created_at":"2016-11-30T18:10:55Z","updated_at":"2016-11-30T18:10:55Z","html_url":"https://github.com/Azure/msrestazure-for-python/pull/8#discussion_r90292269","pull_request_url":"https://api.github.com/repos/Azure/msrestazure-for-python/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/Azure/msrestazure-for-python/pulls/comments/90292269"},"html":{"href":"https://github.com/Azure/msrestazure-for-python/pull/8#discussion_r90292269"},"pull_request":{"href":"https://api.github.com/repos/Azure/msrestazure-for-python/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/msrestazure-for-python/pulls/8","id":95765102,"html_url":"https://github.com/Azure/msrestazure-for-python/pull/8","diff_url":"https://github.com/Azure/msrestazure-for-python/pull/8.diff","patch_url":"https://github.com/Azure/msrestazure-for-python/pull/8.patch","issue_url":"https://api.github.com/repos/Azure/msrestazure-for-python/issues/8","number":8,"state":"open","locked":false,"title":"Adding ADAL wrapper to msrestazure","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars.githubusercontent.com/u/1050156?v=3","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"body":"After discussion with @begoldsm, this allows people other than us (Python team or CLI team) to connect using ADAL, without forcing on ADAL features. \r\n\r\nSamples:\r\n```python\r\nfrom msrestazure.azure_active_directory import AdalAuthentication\r\nimport adal\r\n\r\ncontext = adal.AuthenticationContext('https://login.microsoftonline.com/common')\r\ntoken_retriver = lambda: context.acquire_token_with_username_password(\r\n    'https://management.core.windows.net/',\r\n    'unittest@myaccountoutlook.onmicrosoft.com',\r\n    'PASSWORD!!!',\r\n    '04b07795-8ddb-461a-bbee-02f9e1bf7b46' # Xplat CLI or yours\r\n)\r\nreturn AdalAuthentication(token_retriver)\r\n```\r\n\r\nThis is a 99% copy/paste from CLI code, I almost didn't code anything here, just backport the code from @yugangw-msft. I didn't include ADAL in `install_requires` for now on purpose, I think it's more interesting to do it in `extra_requires`. And be clear in the documentation. Also the main advantage here is that we don't own any ADAL features, so any new stuff can be used directly without changing `msrestazure`.\r\n\r\n@annatisch @brettcannon what do you think?\r\n","created_at":"2016-11-29T20:04:19Z","updated_at":"2016-11-30T18:10:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5aca313c1ea61f2bc8bba77c693f9b262506cd3d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/msrestazure-for-python/pulls/8/commits","review_comments_url":"https://api.github.com/repos/Azure/msrestazure-for-python/pulls/8/comments","review_comment_url":"https://api.github.com/repos/Azure/msrestazure-for-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/msrestazure-for-python/issues/8/comments","statuses_url":"https://api.github.com/repos/Azure/msrestazure-for-python/statuses/82532cf7a7ffb4dfbf9c8404dfa792bee70eb8ce","head":{"label":"Azure:adal_test","ref":"adal_test","sha":"82532cf7a7ffb4dfbf9c8404dfa792bee70eb8ce","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":71186377,"name":"msrestazure-for-python","full_name":"Azure/msrestazure-for-python","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/msrestazure-for-python","description":"The runtime library \"msrestazure\" for AutoRest generated Python clients.","fork":false,"url":"https://api.github.com/repos/Azure/msrestazure-for-python","forks_url":"https://api.github.com/repos/Azure/msrestazure-for-python/forks","keys_url":"https://api.github.com/repos/Azure/msrestazure-for-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/msrestazure-for-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/msrestazure-for-python/teams","hooks_url":"https://api.github.com/repos/Azure/msrestazure-for-python/hooks","issue_events_url":"https://api.github.com/repos/Azure/msrestazure-for-python/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/msrestazure-for-python/events","assignees_url":"https://api.github.com/repos/Azure/msrestazure-for-python/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/msrestazure-for-python/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/msrestazure-for-python/tags","blobs_url":"https://api.github.com/repos/Azure/msrestazure-for-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/msrestazure-for-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/msrestazure-for-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/msrestazure-for-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/msrestazure-for-python/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/msrestazure-for-python/languages","stargazers_url":"https://api.github.com/repos/Azure/msrestazure-for-python/stargazers","contributors_url":"https://api.github.com/repos/Azure/msrestazure-for-python/contributors","subscribers_url":"https://api.github.com/repos/Azure/msrestazure-for-python/subscribers","subscription_url":"https://api.github.com/repos/Azure/msrestazure-for-python/subscription","commits_url":"https://api.github.com/repos/Azure/msrestazure-for-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/msrestazure-for-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/msrestazure-for-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/msrestazure-for-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/msrestazure-for-python/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/msrestazure-for-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/msrestazure-for-python/merges","archive_url":"https://api.github.com/repos/Azure/msrestazure-for-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/msrestazure-for-python/downloads","issues_url":"https://api.github.com/repos/Azure/msrestazure-for-python/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/msrestazure-for-python/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/msrestazure-for-python/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/msrestazure-for-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/msrestazure-for-python/labels{/name}","releases_url":"https://api.github.com/repos/Azure/msrestazure-for-python/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/msrestazure-for-python/deployments","created_at":"2016-10-17T22:25:02Z","updated_at":"2016-10-24T18:51:32Z","pushed_at":"2016-11-30T18:10:49Z","git_url":"git://github.com/Azure/msrestazure-for-python.git","ssh_url":"git@github.com:Azure/msrestazure-for-python.git","clone_url":"https://github.com/Azure/msrestazure-for-python.git","svn_url":"https://github.com/Azure/msrestazure-for-python","homepage":null,"size":55,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"0c03f99d3fd819eb845cd806fb449f421024894c","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":71186377,"name":"msrestazure-for-python","full_name":"Azure/msrestazure-for-python","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/msrestazure-for-python","description":"The runtime library \"msrestazure\" for AutoRest generated Python clients.","fork":false,"url":"https://api.github.com/repos/Azure/msrestazure-for-python","forks_url":"https://api.github.com/repos/Azure/msrestazure-for-python/forks","keys_url":"https://api.github.com/repos/Azure/msrestazure-for-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/msrestazure-for-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/msrestazure-for-python/teams","hooks_url":"https://api.github.com/repos/Azure/msrestazure-for-python/hooks","issue_events_url":"https://api.github.com/repos/Azure/msrestazure-for-python/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/msrestazure-for-python/events","assignees_url":"https://api.github.com/repos/Azure/msrestazure-for-python/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/msrestazure-for-python/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/msrestazure-for-python/tags","blobs_url":"https://api.github.com/repos/Azure/msrestazure-for-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/msrestazure-for-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/msrestazure-for-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/msrestazure-for-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/msrestazure-for-python/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/msrestazure-for-python/languages","stargazers_url":"https://api.github.com/repos/Azure/msrestazure-for-python/stargazers","contributors_url":"https://api.github.com/repos/Azure/msrestazure-for-python/contributors","subscribers_url":"https://api.github.com/repos/Azure/msrestazure-for-python/subscribers","subscription_url":"https://api.github.com/repos/Azure/msrestazure-for-python/subscription","commits_url":"https://api.github.com/repos/Azure/msrestazure-for-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/msrestazure-for-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/msrestazure-for-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/msrestazure-for-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/msrestazure-for-python/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/msrestazure-for-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/msrestazure-for-python/merges","archive_url":"https://api.github.com/repos/Azure/msrestazure-for-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/msrestazure-for-python/downloads","issues_url":"https://api.github.com/repos/Azure/msrestazure-for-python/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/msrestazure-for-python/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/msrestazure-for-python/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/msrestazure-for-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/msrestazure-for-python/labels{/name}","releases_url":"https://api.github.com/repos/Azure/msrestazure-for-python/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/msrestazure-for-python/deployments","created_at":"2016-10-17T22:25:02Z","updated_at":"2016-10-24T18:51:32Z","pushed_at":"2016-11-30T18:10:49Z","git_url":"git://github.com/Azure/msrestazure-for-python.git","ssh_url":"git@github.com:Azure/msrestazure-for-python.git","clone_url":"https://github.com/Azure/msrestazure-for-python.git","svn_url":"https://github.com/Azure/msrestazure-for-python","homepage":null,"size":55,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/msrestazure-for-python/pulls/8"},"html":{"href":"https://github.com/Azure/msrestazure-for-python/pull/8"},"issue":{"href":"https://api.github.com/repos/Azure/msrestazure-for-python/issues/8"},"comments":{"href":"https://api.github.com/repos/Azure/msrestazure-for-python/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/msrestazure-for-python/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/msrestazure-for-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/msrestazure-for-python/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/msrestazure-for-python/statuses/82532cf7a7ffb4dfbf9c8404dfa792bee70eb8ce"}}}}
{"actor":{"display_login":"lmazuel"}}