{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/helios/pulls/comments/31837924","id":31837924,"diff_hunk":"@@ -0,0 +1,188 @@\n+package controllers\n+\n+import (\n+\t\"fmt\"\n+\t\"github.com/RangelReale/osin\"\n+\t\"github.com/Wikia/helios/common\"\n+\t\"github.com/Wikia/helios/config\"\n+\t\"github.com/Wikia/helios/errorlist\"\n+\t\"github.com/Wikia/helios/gateway\"\n+\t\"github.com/Wikia/helios/models\"\n+\t\"github.com/Wikia/helios/service\"\n+\t\"github.com/Wikia/helios/storage\"\n+\t\"github.com/Wikia/helios/validation\"\n+\t\"github.com/influxdb/influxdb/client\"\n+\t\"net/http\"\n+)\n+\n+const (\n+\tFB_AUTH = \"facebook_auth\"\n+)\n+\n+type FacebookController struct {\n+\tserver          *osin.Server\n+\tdeferror        *osin.DefaultErrors\n+\tclientConfig    *config.DefaultClientConfig\n+\tfacebookService service.FacebookService\n+\tinfluxdbClient  *client.Client\n+\tuserStorage     *models.UserStorage\n+\t// TODO: oauth_controller shares this functionality\n+\tallowMultipleAccessTokens bool","path":"controllers/facebook_controller.go","position":30,"original_position":30,"commit_id":"3825f11a63cb7b68b5ed16322586ce66ab7fa7fc","original_commit_id":"3825f11a63cb7b68b5ed16322586ce66ab7fa7fc","user":{"login":"drsnyder","id":21621,"avatar_url":"https://avatars.githubusercontent.com/u/21621?v=3","gravatar_id":"","url":"https://api.github.com/users/drsnyder","html_url":"https://github.com/drsnyder","followers_url":"https://api.github.com/users/drsnyder/followers","following_url":"https://api.github.com/users/drsnyder/following{/other_user}","gists_url":"https://api.github.com/users/drsnyder/gists{/gist_id}","starred_url":"https://api.github.com/users/drsnyder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drsnyder/subscriptions","organizations_url":"https://api.github.com/users/drsnyder/orgs","repos_url":"https://api.github.com/users/drsnyder/repos","events_url":"https://api.github.com/users/drsnyder/events{/privacy}","received_events_url":"https://api.github.com/users/drsnyder/received_events","type":"User","site_admin":false},"body":"This is no longer an issue right? Can it be removed?","created_at":"2015-06-05T18:22:06Z","updated_at":"2015-06-05T18:22:06Z","html_url":"https://github.com/Wikia/helios/pull/42#discussion_r31837924","pull_request_url":"https://api.github.com/repos/Wikia/helios/pulls/42","_links":{"self":{"href":"https://api.github.com/repos/Wikia/helios/pulls/comments/31837924"},"html":{"href":"https://github.com/Wikia/helios/pull/42#discussion_r31837924"},"pull_request":{"href":"https://api.github.com/repos/Wikia/helios/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/helios/pulls/42","id":36352950,"html_url":"https://github.com/Wikia/helios/pull/42","diff_url":"https://github.com/Wikia/helios/pull/42.diff","patch_url":"https://github.com/Wikia/helios/pull/42.patch","issue_url":"https://api.github.com/repos/Wikia/helios/issues/42","number":42,"state":"open","locked":false,"title":"[SERVICES-182] Facebook login connect new account","user":{"login":"ArturKlajnerok","id":1889095,"avatar_url":"https://avatars.githubusercontent.com/u/1889095?v=3","gravatar_id":"","url":"https://api.github.com/users/ArturKlajnerok","html_url":"https://github.com/ArturKlajnerok","followers_url":"https://api.github.com/users/ArturKlajnerok/followers","following_url":"https://api.github.com/users/ArturKlajnerok/following{/other_user}","gists_url":"https://api.github.com/users/ArturKlajnerok/gists{/gist_id}","starred_url":"https://api.github.com/users/ArturKlajnerok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArturKlajnerok/subscriptions","organizations_url":"https://api.github.com/users/ArturKlajnerok/orgs","repos_url":"https://api.github.com/users/ArturKlajnerok/repos","events_url":"https://api.github.com/users/ArturKlajnerok/events{/privacy}","received_events_url":"https://api.github.com/users/ArturKlajnerok/received_events","type":"User","site_admin":false},"body":"Facebook login & Wikia user creation flow works in this manner: \r\n* Client that's already logged in with Facebook makes an request to login user in Wikia with provided fb access token\r\n* If there's no Wikia and Facebook users mapping proper response with that information is returned\r\n* Additional data are required to be passed for user creation as username and password\r\n* Client makes an request to create Wikia user based on additional data and basic Facebook data, also mapping with Wikia and Facebook users need to be done.\r\n\r\n- [x] Facebook graph api support \r\n- [x] Get Facebook user id from graph api\r\n- [x] Check if Facebook account is not already used with Wikia\r\n- [ ] Create Wikia user account\r\n- [x] Create Facebook and Wikia user mapping\r\n","created_at":"2015-05-27T21:55:24Z","updated_at":"2015-06-05T18:22:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"95716182ebe012de105cfa291f789012ada598da","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/helios/pulls/42/commits","review_comments_url":"https://api.github.com/repos/Wikia/helios/pulls/42/comments","review_comment_url":"https://api.github.com/repos/Wikia/helios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/helios/issues/42/comments","statuses_url":"https://api.github.com/repos/Wikia/helios/statuses/3825f11a63cb7b68b5ed16322586ce66ab7fa7fc","head":{"label":"Wikia:SERVICES-182-facebook-login-register-new-account","ref":"SERVICES-182-facebook-login-register-new-account","sha":"3825f11a63cb7b68b5ed16322586ce66ab7fa7fc","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":26176918,"name":"helios","full_name":"Wikia/helios","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/helios","description":"","fork":false,"url":"https://api.github.com/repos/Wikia/helios","forks_url":"https://api.github.com/repos/Wikia/helios/forks","keys_url":"https://api.github.com/repos/Wikia/helios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/helios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/helios/teams","hooks_url":"https://api.github.com/repos/Wikia/helios/hooks","issue_events_url":"https://api.github.com/repos/Wikia/helios/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/helios/events","assignees_url":"https://api.github.com/repos/Wikia/helios/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/helios/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/helios/tags","blobs_url":"https://api.github.com/repos/Wikia/helios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/helios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/helios/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/helios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/helios/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/helios/languages","stargazers_url":"https://api.github.com/repos/Wikia/helios/stargazers","contributors_url":"https://api.github.com/repos/Wikia/helios/contributors","subscribers_url":"https://api.github.com/repos/Wikia/helios/subscribers","subscription_url":"https://api.github.com/repos/Wikia/helios/subscription","commits_url":"https://api.github.com/repos/Wikia/helios/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/helios/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/helios/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/helios/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/helios/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/helios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/helios/merges","archive_url":"https://api.github.com/repos/Wikia/helios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/helios/downloads","issues_url":"https://api.github.com/repos/Wikia/helios/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/helios/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/helios/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/helios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/helios/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/helios/releases{/id}","created_at":"2014-11-04T16:12:05Z","updated_at":"2015-05-08T15:37:52Z","pushed_at":"2015-06-05T18:11:57Z","git_url":"git://github.com/Wikia/helios.git","ssh_url":"git@github.com:Wikia/helios.git","clone_url":"https://github.com/Wikia/helios.git","svn_url":"https://github.com/Wikia/helios","homepage":null,"size":3272,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"Wikia:master","ref":"master","sha":"009a08aeab4e949573370102b8fa881c8dc3b8b3","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":26176918,"name":"helios","full_name":"Wikia/helios","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/helios","description":"","fork":false,"url":"https://api.github.com/repos/Wikia/helios","forks_url":"https://api.github.com/repos/Wikia/helios/forks","keys_url":"https://api.github.com/repos/Wikia/helios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/helios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/helios/teams","hooks_url":"https://api.github.com/repos/Wikia/helios/hooks","issue_events_url":"https://api.github.com/repos/Wikia/helios/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/helios/events","assignees_url":"https://api.github.com/repos/Wikia/helios/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/helios/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/helios/tags","blobs_url":"https://api.github.com/repos/Wikia/helios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/helios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/helios/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/helios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/helios/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/helios/languages","stargazers_url":"https://api.github.com/repos/Wikia/helios/stargazers","contributors_url":"https://api.github.com/repos/Wikia/helios/contributors","subscribers_url":"https://api.github.com/repos/Wikia/helios/subscribers","subscription_url":"https://api.github.com/repos/Wikia/helios/subscription","commits_url":"https://api.github.com/repos/Wikia/helios/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/helios/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/helios/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/helios/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/helios/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/helios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/helios/merges","archive_url":"https://api.github.com/repos/Wikia/helios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/helios/downloads","issues_url":"https://api.github.com/repos/Wikia/helios/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/helios/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/helios/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/helios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/helios/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/helios/releases{/id}","created_at":"2014-11-04T16:12:05Z","updated_at":"2015-05-08T15:37:52Z","pushed_at":"2015-06-05T18:11:57Z","git_url":"git://github.com/Wikia/helios.git","ssh_url":"git@github.com:Wikia/helios.git","clone_url":"https://github.com/Wikia/helios.git","svn_url":"https://github.com/Wikia/helios","homepage":null,"size":3272,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/helios/pulls/42"},"html":{"href":"https://github.com/Wikia/helios/pull/42"},"issue":{"href":"https://api.github.com/repos/Wikia/helios/issues/42"},"comments":{"href":"https://api.github.com/repos/Wikia/helios/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/helios/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/helios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/helios/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/helios/statuses/3825f11a63cb7b68b5ed16322586ce66ab7fa7fc"}}}}