{"action":"created","comment":{"url":"https://api.github.com/repos/hapijs/bell/pulls/comments/32031383","id":32031383,"diff_hunk":"@@ -38,6 +38,7 @@ internals.schema = Joi.object({\n         protocol: Joi.string().valid('oauth', 'oauth2'),\n         temporary: Joi.string().when('protocol', { is: 'oauth', then: Joi.required(), otherwise: Joi.forbidden() }),\n         auth: Joi.string().required(),\n+        authMethod: Joi.string().valid('basic', 'param').when('protocol', { is: 'oauth2', then: Joi.required(), otherwise: Joi.forbidden() }),","path":"lib/index.js","position":4,"original_position":4,"commit_id":"72cf22d240af63222ad0a69540d8a376fb72e840","original_commit_id":"72cf22d240af63222ad0a69540d8a376fb72e840","user":{"login":"hueniverse","id":56631,"avatar_url":"https://avatars.githubusercontent.com/u/56631?v=3","gravatar_id":"","url":"https://api.github.com/users/hueniverse","html_url":"https://github.com/hueniverse","followers_url":"https://api.github.com/users/hueniverse/followers","following_url":"https://api.github.com/users/hueniverse/following{/other_user}","gists_url":"https://api.github.com/users/hueniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/hueniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hueniverse/subscriptions","organizations_url":"https://api.github.com/users/hueniverse/orgs","repos_url":"https://api.github.com/users/hueniverse/repos","events_url":"https://api.github.com/users/hueniverse/events{/privacy}","received_events_url":"https://api.github.com/users/hueniverse/received_events","type":"User","site_admin":false},"body":"I would implement this as a boolean since there are only two ways to authenticate. I would make the default using the header because that's the proper way to do it and allow for a params override.","created_at":"2015-06-09T16:13:19Z","updated_at":"2015-06-09T16:13:19Z","html_url":"https://github.com/hapijs/bell/pull/99#discussion_r32031383","pull_request_url":"https://api.github.com/repos/hapijs/bell/pulls/99","_links":{"self":{"href":"https://api.github.com/repos/hapijs/bell/pulls/comments/32031383"},"html":{"href":"https://github.com/hapijs/bell/pull/99#discussion_r32031383"},"pull_request":{"href":"https://api.github.com/repos/hapijs/bell/pulls/99"}}},"pull_request":{"url":"https://api.github.com/repos/hapijs/bell/pulls/99","id":37077901,"html_url":"https://github.com/hapijs/bell/pull/99","diff_url":"https://github.com/hapijs/bell/pull/99.diff","patch_url":"https://github.com/hapijs/bell/pull/99.patch","issue_url":"https://api.github.com/repos/hapijs/bell/issues/99","number":99,"state":"open","locked":false,"title":"Ensure only 1 authentication method is used during /token access in o…","user":{"login":"ldesplat","id":5972411,"avatar_url":"https://avatars.githubusercontent.com/u/5972411?v=3","gravatar_id":"","url":"https://api.github.com/users/ldesplat","html_url":"https://github.com/ldesplat","followers_url":"https://api.github.com/users/ldesplat/followers","following_url":"https://api.github.com/users/ldesplat/following{/other_user}","gists_url":"https://api.github.com/users/ldesplat/gists{/gist_id}","starred_url":"https://api.github.com/users/ldesplat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldesplat/subscriptions","organizations_url":"https://api.github.com/users/ldesplat/orgs","repos_url":"https://api.github.com/users/ldesplat/repos","events_url":"https://api.github.com/users/ldesplat/events{/privacy}","received_events_url":"https://api.github.com/users/ldesplat/received_events","type":"User","site_admin":false},"body":"…auth2\r\n\r\nAdded authMethod in provider options schema which is required when oauth2 is selected.\r\n\r\nNow, when retrieving the token bell will either use body parameters or basic header auth but not both at the same time. See Issue #98 .\r\n\r\nI have updated all the oauth2 providers as per their specs:\r\n\r\n[arcgisonline](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r30000009z000000)\r\n[dropbox](https://www.dropbox.com/developers/core/docs#oauth2-methods)\r\n[facebook](https://developers.facebook.com/docs/facebook-login/access-tokens#apptokens)\r\n[foursquare](https://developer.foursquare.com/overview/auth)\r\n[github](https://developer.github.com/v3/oauth/)\r\n[google](https://developers.google.com/identity/protocols/OpenIDConnect)\r\n[instagram](https://instagram.com/developer/authentication/)\r\n[linkedin](https://developer.linkedin.com/docs/oauth2)\r\n[live](https://msdn.microsoft.com/en-us/library/hh243647.aspx)\r\n[nest](https://developer.nest.com/documentation/cloud/how-to-auth)\r\n[phabricator](https://secure.phabricator.com/book/phabcontrib/article/using_oauthserver/)\r\n[reddit](https://github.com/reddit/reddit/wiki/OAuth2)\r\n[vk](https://vk.com/dev/auth_sites)\r\n","created_at":"2015-06-05T23:09:03Z","updated_at":"2015-06-09T16:13:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bab56d9d4d6506ef29213efdf852e8b31dc032a2","assignee":{"login":"geek","id":441346,"avatar_url":"https://avatars.githubusercontent.com/u/441346?v=3","gravatar_id":"","url":"https://api.github.com/users/geek","html_url":"https://github.com/geek","followers_url":"https://api.github.com/users/geek/followers","following_url":"https://api.github.com/users/geek/following{/other_user}","gists_url":"https://api.github.com/users/geek/gists{/gist_id}","starred_url":"https://api.github.com/users/geek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geek/subscriptions","organizations_url":"https://api.github.com/users/geek/orgs","repos_url":"https://api.github.com/users/geek/repos","events_url":"https://api.github.com/users/geek/events{/privacy}","received_events_url":"https://api.github.com/users/geek/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/hapijs/bell/milestones/19","html_url":"https://github.com/hapijs/bell/milestones/4.0.0","labels_url":"https://api.github.com/repos/hapijs/bell/milestones/19/labels","id":1138689,"number":19,"title":"4.0.0","description":"","creator":{"login":"geek","id":441346,"avatar_url":"https://avatars.githubusercontent.com/u/441346?v=3","gravatar_id":"","url":"https://api.github.com/users/geek","html_url":"https://github.com/geek","followers_url":"https://api.github.com/users/geek/followers","following_url":"https://api.github.com/users/geek/following{/other_user}","gists_url":"https://api.github.com/users/geek/gists{/gist_id}","starred_url":"https://api.github.com/users/geek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geek/subscriptions","organizations_url":"https://api.github.com/users/geek/orgs","repos_url":"https://api.github.com/users/geek/repos","events_url":"https://api.github.com/users/geek/events{/privacy}","received_events_url":"https://api.github.com/users/geek/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":1,"state":"open","created_at":"2015-05-28T19:49:14Z","updated_at":"2015-06-09T15:32:53Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/hapijs/bell/pulls/99/commits","review_comments_url":"https://api.github.com/repos/hapijs/bell/pulls/99/comments","review_comment_url":"https://api.github.com/repos/hapijs/bell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hapijs/bell/issues/99/comments","statuses_url":"https://api.github.com/repos/hapijs/bell/statuses/72cf22d240af63222ad0a69540d8a376fb72e840","head":{"label":"ldesplat:master","ref":"master","sha":"72cf22d240af63222ad0a69540d8a376fb72e840","user":{"login":"ldesplat","id":5972411,"avatar_url":"https://avatars.githubusercontent.com/u/5972411?v=3","gravatar_id":"","url":"https://api.github.com/users/ldesplat","html_url":"https://github.com/ldesplat","followers_url":"https://api.github.com/users/ldesplat/followers","following_url":"https://api.github.com/users/ldesplat/following{/other_user}","gists_url":"https://api.github.com/users/ldesplat/gists{/gist_id}","starred_url":"https://api.github.com/users/ldesplat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldesplat/subscriptions","organizations_url":"https://api.github.com/users/ldesplat/orgs","repos_url":"https://api.github.com/users/ldesplat/repos","events_url":"https://api.github.com/users/ldesplat/events{/privacy}","received_events_url":"https://api.github.com/users/ldesplat/received_events","type":"User","site_admin":false},"repo":{"id":36957382,"name":"bell","full_name":"ldesplat/bell","owner":{"login":"ldesplat","id":5972411,"avatar_url":"https://avatars.githubusercontent.com/u/5972411?v=3","gravatar_id":"","url":"https://api.github.com/users/ldesplat","html_url":"https://github.com/ldesplat","followers_url":"https://api.github.com/users/ldesplat/followers","following_url":"https://api.github.com/users/ldesplat/following{/other_user}","gists_url":"https://api.github.com/users/ldesplat/gists{/gist_id}","starred_url":"https://api.github.com/users/ldesplat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldesplat/subscriptions","organizations_url":"https://api.github.com/users/ldesplat/orgs","repos_url":"https://api.github.com/users/ldesplat/repos","events_url":"https://api.github.com/users/ldesplat/events{/privacy}","received_events_url":"https://api.github.com/users/ldesplat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ldesplat/bell","description":"Third-party login plugin for hapi","fork":true,"url":"https://api.github.com/repos/ldesplat/bell","forks_url":"https://api.github.com/repos/ldesplat/bell/forks","keys_url":"https://api.github.com/repos/ldesplat/bell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ldesplat/bell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ldesplat/bell/teams","hooks_url":"https://api.github.com/repos/ldesplat/bell/hooks","issue_events_url":"https://api.github.com/repos/ldesplat/bell/issues/events{/number}","events_url":"https://api.github.com/repos/ldesplat/bell/events","assignees_url":"https://api.github.com/repos/ldesplat/bell/assignees{/user}","branches_url":"https://api.github.com/repos/ldesplat/bell/branches{/branch}","tags_url":"https://api.github.com/repos/ldesplat/bell/tags","blobs_url":"https://api.github.com/repos/ldesplat/bell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ldesplat/bell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ldesplat/bell/git/refs{/sha}","trees_url":"https://api.github.com/repos/ldesplat/bell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ldesplat/bell/statuses/{sha}","languages_url":"https://api.github.com/repos/ldesplat/bell/languages","stargazers_url":"https://api.github.com/repos/ldesplat/bell/stargazers","contributors_url":"https://api.github.com/repos/ldesplat/bell/contributors","subscribers_url":"https://api.github.com/repos/ldesplat/bell/subscribers","subscription_url":"https://api.github.com/repos/ldesplat/bell/subscription","commits_url":"https://api.github.com/repos/ldesplat/bell/commits{/sha}","git_commits_url":"https://api.github.com/repos/ldesplat/bell/git/commits{/sha}","comments_url":"https://api.github.com/repos/ldesplat/bell/comments{/number}","issue_comment_url":"https://api.github.com/repos/ldesplat/bell/issues/comments{/number}","contents_url":"https://api.github.com/repos/ldesplat/bell/contents/{+path}","compare_url":"https://api.github.com/repos/ldesplat/bell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ldesplat/bell/merges","archive_url":"https://api.github.com/repos/ldesplat/bell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ldesplat/bell/downloads","issues_url":"https://api.github.com/repos/ldesplat/bell/issues{/number}","pulls_url":"https://api.github.com/repos/ldesplat/bell/pulls{/number}","milestones_url":"https://api.github.com/repos/ldesplat/bell/milestones{/number}","notifications_url":"https://api.github.com/repos/ldesplat/bell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ldesplat/bell/labels{/name}","releases_url":"https://api.github.com/repos/ldesplat/bell/releases{/id}","created_at":"2015-06-05T21:57:05Z","updated_at":"2015-06-05T21:57:06Z","pushed_at":"2015-06-09T00:51:57Z","git_url":"git://github.com/ldesplat/bell.git","ssh_url":"git@github.com:ldesplat/bell.git","clone_url":"https://github.com/ldesplat/bell.git","svn_url":"https://github.com/ldesplat/bell","homepage":null,"size":395,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hapijs:master","ref":"master","sha":"ab59ba4186867882d3a1674b7513cf7db7f4fd4c","user":{"login":"hapijs","id":3774533,"avatar_url":"https://avatars.githubusercontent.com/u/3774533?v=3","gravatar_id":"","url":"https://api.github.com/users/hapijs","html_url":"https://github.com/hapijs","followers_url":"https://api.github.com/users/hapijs/followers","following_url":"https://api.github.com/users/hapijs/following{/other_user}","gists_url":"https://api.github.com/users/hapijs/gists{/gist_id}","starred_url":"https://api.github.com/users/hapijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hapijs/subscriptions","organizations_url":"https://api.github.com/users/hapijs/orgs","repos_url":"https://api.github.com/users/hapijs/repos","events_url":"https://api.github.com/users/hapijs/events{/privacy}","received_events_url":"https://api.github.com/users/hapijs/received_events","type":"Organization","site_admin":false},"repo":{"id":20395079,"name":"bell","full_name":"hapijs/bell","owner":{"login":"hapijs","id":3774533,"avatar_url":"https://avatars.githubusercontent.com/u/3774533?v=3","gravatar_id":"","url":"https://api.github.com/users/hapijs","html_url":"https://github.com/hapijs","followers_url":"https://api.github.com/users/hapijs/followers","following_url":"https://api.github.com/users/hapijs/following{/other_user}","gists_url":"https://api.github.com/users/hapijs/gists{/gist_id}","starred_url":"https://api.github.com/users/hapijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hapijs/subscriptions","organizations_url":"https://api.github.com/users/hapijs/orgs","repos_url":"https://api.github.com/users/hapijs/repos","events_url":"https://api.github.com/users/hapijs/events{/privacy}","received_events_url":"https://api.github.com/users/hapijs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hapijs/bell","description":"Third-party login plugin for hapi","fork":false,"url":"https://api.github.com/repos/hapijs/bell","forks_url":"https://api.github.com/repos/hapijs/bell/forks","keys_url":"https://api.github.com/repos/hapijs/bell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hapijs/bell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hapijs/bell/teams","hooks_url":"https://api.github.com/repos/hapijs/bell/hooks","issue_events_url":"https://api.github.com/repos/hapijs/bell/issues/events{/number}","events_url":"https://api.github.com/repos/hapijs/bell/events","assignees_url":"https://api.github.com/repos/hapijs/bell/assignees{/user}","branches_url":"https://api.github.com/repos/hapijs/bell/branches{/branch}","tags_url":"https://api.github.com/repos/hapijs/bell/tags","blobs_url":"https://api.github.com/repos/hapijs/bell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hapijs/bell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hapijs/bell/git/refs{/sha}","trees_url":"https://api.github.com/repos/hapijs/bell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hapijs/bell/statuses/{sha}","languages_url":"https://api.github.com/repos/hapijs/bell/languages","stargazers_url":"https://api.github.com/repos/hapijs/bell/stargazers","contributors_url":"https://api.github.com/repos/hapijs/bell/contributors","subscribers_url":"https://api.github.com/repos/hapijs/bell/subscribers","subscription_url":"https://api.github.com/repos/hapijs/bell/subscription","commits_url":"https://api.github.com/repos/hapijs/bell/commits{/sha}","git_commits_url":"https://api.github.com/repos/hapijs/bell/git/commits{/sha}","comments_url":"https://api.github.com/repos/hapijs/bell/comments{/number}","issue_comment_url":"https://api.github.com/repos/hapijs/bell/issues/comments{/number}","contents_url":"https://api.github.com/repos/hapijs/bell/contents/{+path}","compare_url":"https://api.github.com/repos/hapijs/bell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hapijs/bell/merges","archive_url":"https://api.github.com/repos/hapijs/bell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hapijs/bell/downloads","issues_url":"https://api.github.com/repos/hapijs/bell/issues{/number}","pulls_url":"https://api.github.com/repos/hapijs/bell/pulls{/number}","milestones_url":"https://api.github.com/repos/hapijs/bell/milestones{/number}","notifications_url":"https://api.github.com/repos/hapijs/bell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hapijs/bell/labels{/name}","releases_url":"https://api.github.com/repos/hapijs/bell/releases{/id}","created_at":"2014-06-02T06:34:28Z","updated_at":"2015-06-08T21:25:57Z","pushed_at":"2015-06-09T15:27:39Z","git_url":"git://github.com/hapijs/bell.git","ssh_url":"git@github.com:hapijs/bell.git","clone_url":"https://github.com/hapijs/bell.git","svn_url":"https://github.com/hapijs/bell","homepage":null,"size":1119,"stargazers_count":183,"watchers_count":183,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":12,"forks":62,"open_issues":12,"watchers":183,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hapijs/bell/pulls/99"},"html":{"href":"https://github.com/hapijs/bell/pull/99"},"issue":{"href":"https://api.github.com/repos/hapijs/bell/issues/99"},"comments":{"href":"https://api.github.com/repos/hapijs/bell/issues/99/comments"},"review_comments":{"href":"https://api.github.com/repos/hapijs/bell/pulls/99/comments"},"review_comment":{"href":"https://api.github.com/repos/hapijs/bell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hapijs/bell/pulls/99/commits"},"statuses":{"href":"https://api.github.com/repos/hapijs/bell/statuses/72cf22d240af63222ad0a69540d8a376fb72e840"}}}}