{"action":"created","issue":{"url":"https://api.github.com/repos/sindresorhus/notifier-for-github-chrome/issues/57","repository_url":"https://api.github.com/repos/sindresorhus/notifier-for-github-chrome","labels_url":"https://api.github.com/repos/sindresorhus/notifier-for-github-chrome/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/notifier-for-github-chrome/issues/57/comments","events_url":"https://api.github.com/repos/sindresorhus/notifier-for-github-chrome/issues/57/events","html_url":"https://github.com/sindresorhus/notifier-for-github-chrome/issues/57","id":132292512,"number":57,"title":"Use chrome.identity.launchWebAuthFlow to get an OAuth token","user":{"login":"ImJasonH","id":210737,"avatar_url":"https://avatars.githubusercontent.com/u/210737?v=3","gravatar_id":"","url":"https://api.github.com/users/ImJasonH","html_url":"https://github.com/ImJasonH","followers_url":"https://api.github.com/users/ImJasonH/followers","following_url":"https://api.github.com/users/ImJasonH/following{/other_user}","gists_url":"https://api.github.com/users/ImJasonH/gists{/gist_id}","starred_url":"https://api.github.com/users/ImJasonH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImJasonH/subscriptions","organizations_url":"https://api.github.com/users/ImJasonH/orgs","repos_url":"https://api.github.com/users/ImJasonH/repos","events_url":"https://api.github.com/users/ImJasonH/events{/privacy}","received_events_url":"https://api.github.com/users/ImJasonH/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sindresorhus/notifier-for-github-chrome/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/sindresorhus/notifier-for-github-chrome/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-02-08T23:58:10Z","updated_at":"2016-08-24T14:37:01Z","closed_at":null,"body":"https://developer.chrome.com/apps/identity#method-launchWebAuthFlow\r\n\r\n```\r\nvar CALLBACK_URL = 'https://'+chrome.runtime.id+'.chromiumapp.org';\r\nvar AUTH_URL = 'https://github.com/login/oauth/authorize/?client_id='+CLIENT_ID+'&redirect_uri='+CALLBACK_URL+'&scope=notifications';\r\n...\r\n// Opens a window to initiate GitHub OAuth, fires callback\r\n// with token in the URL.\r\nchrome.identity.launchWebAuthFlow({\r\n  url: AUTH_URL,\r\n  interactive: true,\r\n}, function(redirectURL) {\r\n  var q = redirectURL.substr(redirectURL.indexOf('#')+1);\r\n  var parts = q.split('&');\r\n  for (var i = 0; i < parts.length; i++) {\r\n    var kv = parts[i].split('=');\r\n    if (kv[0] == 'access_token') {\r\n      token = kv[1];\r\n      console.log('token is', token);\r\n    }\r\n  }\r\n});\r\n```\r\n\r\nThis would remove the need for users to generate a personal access token and copy/paste it in themselves."},"comment":{"url":"https://api.github.com/repos/sindresorhus/notifier-for-github-chrome/issues/comments/242087299","html_url":"https://github.com/sindresorhus/notifier-for-github-chrome/issues/57#issuecomment-242087299","issue_url":"https://api.github.com/repos/sindresorhus/notifier-for-github-chrome/issues/57","id":242087299,"user":{"login":"YurySolovyov","id":2168518,"avatar_url":"https://avatars.githubusercontent.com/u/2168518?v=3","gravatar_id":"","url":"https://api.github.com/users/YurySolovyov","html_url":"https://github.com/YurySolovyov","followers_url":"https://api.github.com/users/YurySolovyov/followers","following_url":"https://api.github.com/users/YurySolovyov/following{/other_user}","gists_url":"https://api.github.com/users/YurySolovyov/gists{/gist_id}","starred_url":"https://api.github.com/users/YurySolovyov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YurySolovyov/subscriptions","organizations_url":"https://api.github.com/users/YurySolovyov/orgs","repos_url":"https://api.github.com/users/YurySolovyov/repos","events_url":"https://api.github.com/users/YurySolovyov/events{/privacy}","received_events_url":"https://api.github.com/users/YurySolovyov/received_events","type":"User","site_admin":false},"created_at":"2016-08-24T14:37:01Z","updated_at":"2016-08-24T14:37:01Z","body":"@sindresorhus thanks, obviously blocked by #90 for now"}}
{"actor":{"display_login":"YurySolovyov"}}