{"action":"created","issue":{"url":"https://api.github.com/repos/hackmdio/hackmd/issues/784","repository_url":"https://api.github.com/repos/hackmdio/hackmd","labels_url":"https://api.github.com/repos/hackmdio/hackmd/issues/784/labels{/name}","comments_url":"https://api.github.com/repos/hackmdio/hackmd/issues/784/comments","events_url":"https://api.github.com/repos/hackmdio/hackmd/issues/784/events","html_url":"https://github.com/hackmdio/hackmd/pull/784","id":308550419,"node_id":"MDExOlB1bGxSZXF1ZXN0MTc3NDI5NzIw","number":784,"title":"Add \"generic\" OAuth2 support","user":{"login":"pferreir","id":2699,"node_id":"MDQ6VXNlcjI2OTk=","avatar_url":"https://avatars3.githubusercontent.com/u/2699?v=4","gravatar_id":"","url":"https://api.github.com/users/pferreir","html_url":"https://github.com/pferreir","followers_url":"https://api.github.com/users/pferreir/followers","following_url":"https://api.github.com/users/pferreir/following{/other_user}","gists_url":"https://api.github.com/users/pferreir/gists{/gist_id}","starred_url":"https://api.github.com/users/pferreir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pferreir/subscriptions","organizations_url":"https://api.github.com/users/pferreir/orgs","repos_url":"https://api.github.com/users/pferreir/repos","events_url":"https://api.github.com/users/pferreir/events{/privacy}","received_events_url":"https://api.github.com/users/pferreir/received_events","type":"User","site_admin":false},"labels":[{"id":717759998,"node_id":"MDU6TGFiZWw3MTc3NTk5OTg=","url":"https://api.github.com/repos/hackmdio/hackmd/labels/auth%20provider","name":"auth provider","color":"a2a5a0","default":false},{"id":264347483,"node_id":"MDU6TGFiZWwyNjQzNDc0ODM=","url":"https://api.github.com/repos/hackmdio/hackmd/labels/feature","name":"feature","color":"0052cc","default":false},{"id":712773388,"node_id":"MDU6TGFiZWw3MTI3NzMzODg=","url":"https://api.github.com/repos/hackmdio/hackmd/labels/untested","name":"untested","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/hackmdio/hackmd/milestones/15","html_url":"https://github.com/hackmdio/hackmd/milestone/15","labels_url":"https://api.github.com/repos/hackmdio/hackmd/milestones/15/labels","id":3045877,"node_id":"MDk6TWlsZXN0b25lMzA0NTg3Nw==","number":15,"title":"1.2.0-CE Release","description":"Everything in this milestone should be merged or closed for the 1.2.0-CE release","creator":{"login":"SISheogorath","id":8719867,"node_id":"MDQ6VXNlcjg3MTk4Njc=","avatar_url":"https://avatars1.githubusercontent.com/u/8719867?v=4","gravatar_id":"","url":"https://api.github.com/users/SISheogorath","html_url":"https://github.com/SISheogorath","followers_url":"https://api.github.com/users/SISheogorath/followers","following_url":"https://api.github.com/users/SISheogorath/following{/other_user}","gists_url":"https://api.github.com/users/SISheogorath/gists{/gist_id}","starred_url":"https://api.github.com/users/SISheogorath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SISheogorath/subscriptions","organizations_url":"https://api.github.com/users/SISheogorath/orgs","repos_url":"https://api.github.com/users/SISheogorath/repos","events_url":"https://api.github.com/users/SISheogorath/events{/privacy}","received_events_url":"https://api.github.com/users/SISheogorath/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":4,"state":"open","created_at":"2018-01-18T16:10:09Z","updated_at":"2018-06-04T13:14:39Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2018-03-26T12:26:03Z","updated_at":"2018-06-04T13:33:52Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/hackmdio/hackmd/pulls/784","html_url":"https://github.com/hackmdio/hackmd/pull/784","diff_url":"https://github.com/hackmdio/hackmd/pull/784.diff","patch_url":"https://github.com/hackmdio/hackmd/pull/784.patch"},"body":"The currently available OAuth methods are limited to a few providers. This PR implements a \"generic\" OAuth workflow which will fetch user profile info from a given JSON endpoint and extract a set of configurable fields. Example:\r\n\r\n```json\r\n        \"oauth2\": {\r\n          \"clientID\": \"test_hackmd_notasbad\",\r\n          \"clientSecret\": \"lc05GbmUT5crF33341CcpDbliG8KNW0HS4p9sS91Vx81\",\r\n          \"authorizationURL\": \"https://authprovider/oauth/authorize\",\r\n          \"tokenURL\": \"https://authprovider/oauth/token\",\r\n          \"userProfileURL\": \"https://authprovider/api/user\",\r\n          \"userProfileUsernameAttr\": \"username\",\r\n          \"userProfileDisplayNameAttr\": \"data.displayName\",\r\n          \"userProfileEmailAttr\": \"email\"\r\n        }\r\n```\r\n\r\nI tried to guide myself by the existing OAuth provider definitions, please let me know if there are any better ways of doing what I'm trying to do."},"comment":{"url":"https://api.github.com/repos/hackmdio/hackmd/issues/comments/394356119","html_url":"https://github.com/hackmdio/hackmd/pull/784#issuecomment-394356119","issue_url":"https://api.github.com/repos/hackmdio/hackmd/issues/784","id":394356119,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDM1NjExOQ==","user":{"login":"pferreir","id":2699,"node_id":"MDQ6VXNlcjI2OTk=","avatar_url":"https://avatars3.githubusercontent.com/u/2699?v=4","gravatar_id":"","url":"https://api.github.com/users/pferreir","html_url":"https://github.com/pferreir","followers_url":"https://api.github.com/users/pferreir/followers","following_url":"https://api.github.com/users/pferreir/following{/other_user}","gists_url":"https://api.github.com/users/pferreir/gists{/gist_id}","starred_url":"https://api.github.com/users/pferreir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pferreir/subscriptions","organizations_url":"https://api.github.com/users/pferreir/orgs","repos_url":"https://api.github.com/users/pferreir/repos","events_url":"https://api.github.com/users/pferreir/events{/privacy}","received_events_url":"https://api.github.com/users/pferreir/received_events","type":"User","site_admin":false},"created_at":"2018-06-04T13:33:52Z","updated_at":"2018-06-04T13:33:52Z","author_association":"CONTRIBUTOR","body":"@SISheogorath That is actually the code we are using right now at my organization. It works here :)"}}
{"actor":{"display_login":"pferreir"}}