{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/comments/234492717","pull_request_review_id":176142393,"id":234492717,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDQ5MjcxNw==","diff_hunk":"@@ -0,0 +1,52 @@\n+/*\n+ * Copyright (c) Microsoft Corporation\n+ *\n+ * All rights reserved.\n+ *\n+ * MIT License\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n+ * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n+ * the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n+ * SOFTWARE.\n+ */\n+\n+package com.microsoft.azuretools.ijidea.ui;\n+\n+import com.intellij.openapi.application.ApplicationManager;\n+import com.microsoft.aad.adal4j.AuthenticationCallback;\n+import com.microsoft.aad.adal4j.AuthenticationContext;\n+import com.microsoft.aad.adal4j.AuthenticationResult;\n+import com.microsoft.aad.adal4j.DeviceCode;\n+import com.microsoft.azuretools.adauth.IDeviceLoginUI;\n+\n+public class DeviceLoginUI implements IDeviceLoginUI {\n+    private DeviceLoginWindow deviceLoginWindow;\n+\n+    @Override\n+    public AuthenticationResult authenticate(final AuthenticationContext ctx, final DeviceCode deviceCode,\n+                                             final AuthenticationCallback<AuthenticationResult> callback) {\n+\n+        if (ApplicationManager.getApplication().isDispatchThread()) {\n+            buildAndShow(ctx, deviceCode, callback);\n+        } else {\n+            ApplicationManager.getApplication().invokeAndWait(() -> buildAndShow(ctx, deviceCode, callback));\n+        }\n+        return deviceLoginWindow.getAuthenticationResult();","path":"PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azuretools/ijidea/ui/DeviceLoginUI.java","position":48,"original_position":44,"commit_id":"67774414d5222eec5ab7748cd73af68d6bcff49c","original_commit_id":"a06f49736bd158120b5b488080cdb95cd9866669","user":{"login":"SummerSun","id":5179063,"node_id":"MDQ6VXNlcjUxNzkwNjM=","avatar_url":"https://avatars0.githubusercontent.com/u/5179063?v=4","gravatar_id":"","url":"https://api.github.com/users/SummerSun","html_url":"https://github.com/SummerSun","followers_url":"https://api.github.com/users/SummerSun/followers","following_url":"https://api.github.com/users/SummerSun/following{/other_user}","gists_url":"https://api.github.com/users/SummerSun/gists{/gist_id}","starred_url":"https://api.github.com/users/SummerSun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SummerSun/subscriptions","organizations_url":"https://api.github.com/users/SummerSun/orgs","repos_url":"https://api.github.com/users/SummerSun/repos","events_url":"https://api.github.com/users/SummerSun/events{/privacy}","received_events_url":"https://api.github.com/users/SummerSun/received_events","type":"User","site_admin":false},"body":"Oh, are you suggesting better naming the `authenticate` to `showAndGet`?","created_at":"2018-11-19T04:42:18Z","updated_at":"2018-11-19T04:42:18Z","html_url":"https://github.com/Microsoft/azure-tools-for-java/pull/2350#discussion_r234492717","pull_request_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/2350","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/comments/234492717"},"html":{"href":"https://github.com/Microsoft/azure-tools-for-java/pull/2350#discussion_r234492717"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/2350"}},"in_reply_to_id":234105493},"pull_request":{"url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/2350","id":230480101,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwNDgwMTAx","html_url":"https://github.com/Microsoft/azure-tools-for-java/pull/2350","diff_url":"https://github.com/Microsoft/azure-tools-for-java/pull/2350.diff","patch_url":"https://github.com/Microsoft/azure-tools-for-java/pull/2350.patch","issue_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/issues/2350","number":2350,"state":"open","locked":false,"title":"Enable device login","user":{"login":"SummerSun","id":5179063,"node_id":"MDQ6VXNlcjUxNzkwNjM=","avatar_url":"https://avatars0.githubusercontent.com/u/5179063?v=4","gravatar_id":"","url":"https://api.github.com/users/SummerSun","html_url":"https://github.com/SummerSun","followers_url":"https://api.github.com/users/SummerSun/followers","following_url":"https://api.github.com/users/SummerSun/following{/other_user}","gists_url":"https://api.github.com/users/SummerSun/gists{/gist_id}","starred_url":"https://api.github.com/users/SummerSun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SummerSun/subscriptions","organizations_url":"https://api.github.com/users/SummerSun/orgs","repos_url":"https://api.github.com/users/SummerSun/repos","events_url":"https://api.github.com/users/SummerSun/events{/privacy}","received_events_url":"https://api.github.com/users/SummerSun/received_events","type":"User","site_admin":false},"body":"#### Enable the device login and make it the default login method\r\nCreate an interface `IDeviceLoginUI` to show device login message and notify the API when device login is cancelled.\r\n\r\n![comment](https://user-images.githubusercontent.com/5179063/48416896-55757980-e78c-11e8-9482-4ed1801c5a1d.gif)\r\n","created_at":"2018-11-13T13:44:57Z","updated_at":"2018-11-19T04:42:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec1eaefd443823a7ab98b0bee316601f29b13670","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/2350/commits","review_comments_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/2350/comments","review_comment_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/issues/2350/comments","statuses_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/statuses/67774414d5222eec5ab7748cd73af68d6bcff49c","head":{"label":"SummerSun:device","ref":"device","sha":"67774414d5222eec5ab7748cd73af68d6bcff49c","user":{"login":"SummerSun","id":5179063,"node_id":"MDQ6VXNlcjUxNzkwNjM=","avatar_url":"https://avatars0.githubusercontent.com/u/5179063?v=4","gravatar_id":"","url":"https://api.github.com/users/SummerSun","html_url":"https://github.com/SummerSun","followers_url":"https://api.github.com/users/SummerSun/followers","following_url":"https://api.github.com/users/SummerSun/following{/other_user}","gists_url":"https://api.github.com/users/SummerSun/gists{/gist_id}","starred_url":"https://api.github.com/users/SummerSun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SummerSun/subscriptions","organizations_url":"https://api.github.com/users/SummerSun/orgs","repos_url":"https://api.github.com/users/SummerSun/repos","events_url":"https://api.github.com/users/SummerSun/events{/privacy}","received_events_url":"https://api.github.com/users/SummerSun/received_events","type":"User","site_admin":false},"repo":{"id":129345551,"node_id":"MDEwOlJlcG9zaXRvcnkxMjkzNDU1NTE=","name":"azure-tools-for-java","full_name":"SummerSun/azure-tools-for-java","private":false,"owner":{"login":"SummerSun","id":5179063,"node_id":"MDQ6VXNlcjUxNzkwNjM=","avatar_url":"https://avatars0.githubusercontent.com/u/5179063?v=4","gravatar_id":"","url":"https://api.github.com/users/SummerSun","html_url":"https://github.com/SummerSun","followers_url":"https://api.github.com/users/SummerSun/followers","following_url":"https://api.github.com/users/SummerSun/following{/other_user}","gists_url":"https://api.github.com/users/SummerSun/gists{/gist_id}","starred_url":"https://api.github.com/users/SummerSun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SummerSun/subscriptions","organizations_url":"https://api.github.com/users/SummerSun/orgs","repos_url":"https://api.github.com/users/SummerSun/repos","events_url":"https://api.github.com/users/SummerSun/events{/privacy}","received_events_url":"https://api.github.com/users/SummerSun/received_events","type":"User","site_admin":false},"html_url":"https://github.com/SummerSun/azure-tools-for-java","description":"Azure tools for Java, including Azure Toolkits for Eclipse, IntelliJ and related projects.","fork":true,"url":"https://api.github.com/repos/SummerSun/azure-tools-for-java","forks_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/forks","keys_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/teams","hooks_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/hooks","issue_events_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/issues/events{/number}","events_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/events","assignees_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/assignees{/user}","branches_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/branches{/branch}","tags_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/tags","blobs_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/statuses/{sha}","languages_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/languages","stargazers_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/stargazers","contributors_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/contributors","subscribers_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/subscribers","subscription_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/subscription","commits_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/contents/{+path}","compare_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/merges","archive_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/downloads","issues_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/issues{/number}","pulls_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/pulls{/number}","milestones_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/milestones{/number}","notifications_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/labels{/name}","releases_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/releases{/id}","deployments_url":"https://api.github.com/repos/SummerSun/azure-tools-for-java/deployments","created_at":"2018-04-13T04:01:15Z","updated_at":"2018-11-07T00:40:14Z","pushed_at":"2018-11-19T04:40:17Z","git_url":"git://github.com/SummerSun/azure-tools-for-java.git","ssh_url":"git@github.com:SummerSun/azure-tools-for-java.git","clone_url":"https://github.com/SummerSun/azure-tools-for-java.git","svn_url":"https://github.com/SummerSun/azure-tools-for-java","homepage":null,"size":91432,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"Microsoft:develop","ref":"develop","sha":"c9d9da8d0582c9c1828f4bba88621645159f20a0","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":53603813,"node_id":"MDEwOlJlcG9zaXRvcnk1MzYwMzgxMw==","name":"azure-tools-for-java","full_name":"Microsoft/azure-tools-for-java","private":false,"owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Microsoft/azure-tools-for-java","description":"Azure tools for Java, including Azure Toolkits for Eclipse, IntelliJ and related projects.","fork":false,"url":"https://api.github.com/repos/Microsoft/azure-tools-for-java","forks_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/forks","keys_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/teams","hooks_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/events","assignees_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/tags","blobs_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/languages","stargazers_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/subscription","commits_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/merges","archive_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/downloads","issues_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/deployments","created_at":"2016-03-10T17:29:21Z","updated_at":"2018-11-16T06:40:16Z","pushed_at":"2018-11-19T04:40:19Z","git_url":"git://github.com/Microsoft/azure-tools-for-java.git","ssh_url":"git@github.com:Microsoft/azure-tools-for-java.git","clone_url":"https://github.com/Microsoft/azure-tools-for-java.git","svn_url":"https://github.com/Microsoft/azure-tools-for-java","homepage":null,"size":91398,"stargazers_count":97,"watchers_count":97,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":75,"mirror_url":null,"archived":false,"open_issues_count":347,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":75,"open_issues":347,"watchers":97,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/2350"},"html":{"href":"https://github.com/Microsoft/azure-tools-for-java/pull/2350"},"issue":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/issues/2350"},"comments":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/issues/2350/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/2350/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/2350/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/statuses/67774414d5222eec5ab7748cd73af68d6bcff49c"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"SummerSun"}}