{"action":"created","comment":{"url":"https://api.github.com/repos/auth0/ruby-auth0/pulls/comments/102551331","pull_request_review_id":23310733,"id":102551331,"diff_hunk":"@@ -7,35 +7,48 @@ module AuthenticationEndpoints\n       UP_AUTH = 'Username-Password-Authentication'.freeze\n       JWT_BEARER = 'urn:ietf:params:oauth:grant-type:jwt-bearer'.freeze\n \n-      # Retrives an access token\n-      # @see https://auth0.com/docs/auth-api#!#post--oauth-access_token\n+      # Given the social provider's access_token and the connection, this endpoint will authenticate the user\n+      # with the provider and return a JSON with the access_token and, optionally, an id_token\n+      # @see https://auth0.com/docs/api/authentication#social-with-provider-s-access-token\n       # @param access_token [string] Social provider's access_token\n       # @param connection [string] Currently, this endpoint only works for Facebook, Google, Twitter and Weibo\n+      # @param scope [string] Use openid to get an id_token, or openid profile email to include user information\n+      #   in the id_token. If null, only an access_token will be returned.\n+      # @return [json] Returns the access token\n+      def obtain_access_token(access_token, connection = 'facebook', scope = 'openid')\n+        raise Auth0::InvalidParameter, 'Must supply a valid code' if access_token.to_s.empty?\n+        request_params = { client_id: @client_id, access_token: access_token, connection: connection, scope: scope }\n+        post('/oauth/access_token', request_params)['access_token']\n+      end\n+\n+      # This is the OAuth 2.0 grant that server processes utilize in order to access an API.\n+      # Use this endpoint to directly request an access_token by using the Client Credentials\n+      # @see https://auth0.com/docs/api/authentication#client-credentials\n+      # @param audience [string] The unique identifier of the target API you want to access.\n       # @return [json] Returns the access token\n-      def obtain_access_token(access_token = nil, connection = 'facebook', scope = 'openid')\n-        if access_token\n-          request_params = { client_id: @client_id, access_token: access_token, connection: connection, scope: scope }\n-          post('/oauth/access_token', request_params)['access_token']\n-        else\n-          request_params = { client_id: @client_id, client_secret: @client_secret, grant_type: 'client_credentials' }\n-          post('/oauth/token', request_params)['access_token']\n-        end\n+      def client_credentials(audience = nil)","path":"lib/auth0/api/authentication_endpoints.rb","position":33,"original_position":33,"commit_id":"fab6ab95a9a9b6ce137a857a3b288148f3c803b6","original_commit_id":"fab6ab95a9a9b6ce137a857a3b288148f3c803b6","user":{"login":"leosoubeste","id":2564586,"avatar_url":"https://avatars.githubusercontent.com/u/2564586?v=3","gravatar_id":"","url":"https://api.github.com/users/leosoubeste","html_url":"https://github.com/leosoubeste","followers_url":"https://api.github.com/users/leosoubeste/followers","following_url":"https://api.github.com/users/leosoubeste/following{/other_user}","gists_url":"https://api.github.com/users/leosoubeste/gists{/gist_id}","starred_url":"https://api.github.com/users/leosoubeste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leosoubeste/subscriptions","organizations_url":"https://api.github.com/users/leosoubeste/orgs","repos_url":"https://api.github.com/users/leosoubeste/repos","events_url":"https://api.github.com/users/leosoubeste/events{/privacy}","received_events_url":"https://api.github.com/users/leosoubeste/received_events","type":"User","site_admin":false},"body":"Changed.","created_at":"2017-02-22T19:31:17Z","updated_at":"2017-02-22T19:31:18Z","html_url":"https://github.com/auth0/ruby-auth0/pull/82#discussion_r102551331","pull_request_url":"https://api.github.com/repos/auth0/ruby-auth0/pulls/82","_links":{"self":{"href":"https://api.github.com/repos/auth0/ruby-auth0/pulls/comments/102551331"},"html":{"href":"https://github.com/auth0/ruby-auth0/pull/82#discussion_r102551331"},"pull_request":{"href":"https://api.github.com/repos/auth0/ruby-auth0/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/auth0/ruby-auth0/pulls/82","id":107456865,"html_url":"https://github.com/auth0/ruby-auth0/pull/82","diff_url":"https://github.com/auth0/ruby-auth0/pull/82.diff","patch_url":"https://github.com/auth0/ruby-auth0/pull/82.patch","issue_url":"https://api.github.com/repos/auth0/ruby-auth0/issues/82","number":82,"state":"open","locked":false,"title":"SDK changes lsoubeste","user":{"login":"leosoubeste","id":2564586,"avatar_url":"https://avatars.githubusercontent.com/u/2564586?v=3","gravatar_id":"","url":"https://api.github.com/users/leosoubeste","html_url":"https://github.com/leosoubeste","followers_url":"https://api.github.com/users/leosoubeste/followers","following_url":"https://api.github.com/users/leosoubeste/following{/other_user}","gists_url":"https://api.github.com/users/leosoubeste/gists{/gist_id}","starred_url":"https://api.github.com/users/leosoubeste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leosoubeste/subscriptions","organizations_url":"https://api.github.com/users/leosoubeste/orgs","repos_url":"https://api.github.com/users/leosoubeste/repos","events_url":"https://api.github.com/users/leosoubeste/events{/privacy}","received_events_url":"https://api.github.com/users/leosoubeste/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-02-22T17:22:44Z","updated_at":"2017-02-22T19:31:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbfc1fabd64e8a213efcab7923812f405e4a75ee","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/auth0/ruby-auth0/pulls/82/commits","review_comments_url":"https://api.github.com/repos/auth0/ruby-auth0/pulls/82/comments","review_comment_url":"https://api.github.com/repos/auth0/ruby-auth0/pulls/comments{/number}","comments_url":"https://api.github.com/repos/auth0/ruby-auth0/issues/82/comments","statuses_url":"https://api.github.com/repos/auth0/ruby-auth0/statuses/fab6ab95a9a9b6ce137a857a3b288148f3c803b6","head":{"label":"leosoubeste:master","ref":"master","sha":"fab6ab95a9a9b6ce137a857a3b288148f3c803b6","user":{"login":"leosoubeste","id":2564586,"avatar_url":"https://avatars.githubusercontent.com/u/2564586?v=3","gravatar_id":"","url":"https://api.github.com/users/leosoubeste","html_url":"https://github.com/leosoubeste","followers_url":"https://api.github.com/users/leosoubeste/followers","following_url":"https://api.github.com/users/leosoubeste/following{/other_user}","gists_url":"https://api.github.com/users/leosoubeste/gists{/gist_id}","starred_url":"https://api.github.com/users/leosoubeste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leosoubeste/subscriptions","organizations_url":"https://api.github.com/users/leosoubeste/orgs","repos_url":"https://api.github.com/users/leosoubeste/repos","events_url":"https://api.github.com/users/leosoubeste/events{/privacy}","received_events_url":"https://api.github.com/users/leosoubeste/received_events","type":"User","site_admin":false},"repo":{"id":79264245,"name":"ruby-auth0","full_name":"leosoubeste/ruby-auth0","owner":{"login":"leosoubeste","id":2564586,"avatar_url":"https://avatars.githubusercontent.com/u/2564586?v=3","gravatar_id":"","url":"https://api.github.com/users/leosoubeste","html_url":"https://github.com/leosoubeste","followers_url":"https://api.github.com/users/leosoubeste/followers","following_url":"https://api.github.com/users/leosoubeste/following{/other_user}","gists_url":"https://api.github.com/users/leosoubeste/gists{/gist_id}","starred_url":"https://api.github.com/users/leosoubeste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leosoubeste/subscriptions","organizations_url":"https://api.github.com/users/leosoubeste/orgs","repos_url":"https://api.github.com/users/leosoubeste/repos","events_url":"https://api.github.com/users/leosoubeste/events{/privacy}","received_events_url":"https://api.github.com/users/leosoubeste/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leosoubeste/ruby-auth0","description":"Ruby toolkit for Auth0 API","fork":true,"url":"https://api.github.com/repos/leosoubeste/ruby-auth0","forks_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/forks","keys_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/teams","hooks_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/hooks","issue_events_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/issues/events{/number}","events_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/events","assignees_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/assignees{/user}","branches_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/branches{/branch}","tags_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/tags","blobs_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/git/refs{/sha}","trees_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/statuses/{sha}","languages_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/languages","stargazers_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/stargazers","contributors_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/contributors","subscribers_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/subscribers","subscription_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/subscription","commits_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/commits{/sha}","git_commits_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/git/commits{/sha}","comments_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/comments{/number}","issue_comment_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/issues/comments{/number}","contents_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/contents/{+path}","compare_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/merges","archive_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/downloads","issues_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/issues{/number}","pulls_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/pulls{/number}","milestones_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/milestones{/number}","notifications_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/labels{/name}","releases_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/releases{/id}","deployments_url":"https://api.github.com/repos/leosoubeste/ruby-auth0/deployments","created_at":"2017-01-17T19:36:58Z","updated_at":"2017-01-17T19:37:01Z","pushed_at":"2017-02-20T06:56:01Z","git_url":"git://github.com/leosoubeste/ruby-auth0.git","ssh_url":"git@github.com:leosoubeste/ruby-auth0.git","clone_url":"https://github.com/leosoubeste/ruby-auth0.git","svn_url":"https://github.com/leosoubeste/ruby-auth0","homepage":"https://auth0.com/","size":1010,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"auth0:master","ref":"master","sha":"a9a3f5490d57edeb36a7bcc7603a65390650aa5f","user":{"login":"auth0","id":2824157,"avatar_url":"https://avatars.githubusercontent.com/u/2824157?v=3","gravatar_id":"","url":"https://api.github.com/users/auth0","html_url":"https://github.com/auth0","followers_url":"https://api.github.com/users/auth0/followers","following_url":"https://api.github.com/users/auth0/following{/other_user}","gists_url":"https://api.github.com/users/auth0/gists{/gist_id}","starred_url":"https://api.github.com/users/auth0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auth0/subscriptions","organizations_url":"https://api.github.com/users/auth0/orgs","repos_url":"https://api.github.com/users/auth0/repos","events_url":"https://api.github.com/users/auth0/events{/privacy}","received_events_url":"https://api.github.com/users/auth0/received_events","type":"Organization","site_admin":false},"repo":{"id":21049751,"name":"ruby-auth0","full_name":"auth0/ruby-auth0","owner":{"login":"auth0","id":2824157,"avatar_url":"https://avatars.githubusercontent.com/u/2824157?v=3","gravatar_id":"","url":"https://api.github.com/users/auth0","html_url":"https://github.com/auth0","followers_url":"https://api.github.com/users/auth0/followers","following_url":"https://api.github.com/users/auth0/following{/other_user}","gists_url":"https://api.github.com/users/auth0/gists{/gist_id}","starred_url":"https://api.github.com/users/auth0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auth0/subscriptions","organizations_url":"https://api.github.com/users/auth0/orgs","repos_url":"https://api.github.com/users/auth0/repos","events_url":"https://api.github.com/users/auth0/events{/privacy}","received_events_url":"https://api.github.com/users/auth0/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/auth0/ruby-auth0","description":"Ruby toolkit for Auth0 API","fork":false,"url":"https://api.github.com/repos/auth0/ruby-auth0","forks_url":"https://api.github.com/repos/auth0/ruby-auth0/forks","keys_url":"https://api.github.com/repos/auth0/ruby-auth0/keys{/key_id}","collaborators_url":"https://api.github.com/repos/auth0/ruby-auth0/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/auth0/ruby-auth0/teams","hooks_url":"https://api.github.com/repos/auth0/ruby-auth0/hooks","issue_events_url":"https://api.github.com/repos/auth0/ruby-auth0/issues/events{/number}","events_url":"https://api.github.com/repos/auth0/ruby-auth0/events","assignees_url":"https://api.github.com/repos/auth0/ruby-auth0/assignees{/user}","branches_url":"https://api.github.com/repos/auth0/ruby-auth0/branches{/branch}","tags_url":"https://api.github.com/repos/auth0/ruby-auth0/tags","blobs_url":"https://api.github.com/repos/auth0/ruby-auth0/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/auth0/ruby-auth0/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/auth0/ruby-auth0/git/refs{/sha}","trees_url":"https://api.github.com/repos/auth0/ruby-auth0/git/trees{/sha}","statuses_url":"https://api.github.com/repos/auth0/ruby-auth0/statuses/{sha}","languages_url":"https://api.github.com/repos/auth0/ruby-auth0/languages","stargazers_url":"https://api.github.com/repos/auth0/ruby-auth0/stargazers","contributors_url":"https://api.github.com/repos/auth0/ruby-auth0/contributors","subscribers_url":"https://api.github.com/repos/auth0/ruby-auth0/subscribers","subscription_url":"https://api.github.com/repos/auth0/ruby-auth0/subscription","commits_url":"https://api.github.com/repos/auth0/ruby-auth0/commits{/sha}","git_commits_url":"https://api.github.com/repos/auth0/ruby-auth0/git/commits{/sha}","comments_url":"https://api.github.com/repos/auth0/ruby-auth0/comments{/number}","issue_comment_url":"https://api.github.com/repos/auth0/ruby-auth0/issues/comments{/number}","contents_url":"https://api.github.com/repos/auth0/ruby-auth0/contents/{+path}","compare_url":"https://api.github.com/repos/auth0/ruby-auth0/compare/{base}...{head}","merges_url":"https://api.github.com/repos/auth0/ruby-auth0/merges","archive_url":"https://api.github.com/repos/auth0/ruby-auth0/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/auth0/ruby-auth0/downloads","issues_url":"https://api.github.com/repos/auth0/ruby-auth0/issues{/number}","pulls_url":"https://api.github.com/repos/auth0/ruby-auth0/pulls{/number}","milestones_url":"https://api.github.com/repos/auth0/ruby-auth0/milestones{/number}","notifications_url":"https://api.github.com/repos/auth0/ruby-auth0/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/auth0/ruby-auth0/labels{/name}","releases_url":"https://api.github.com/repos/auth0/ruby-auth0/releases{/id}","deployments_url":"https://api.github.com/repos/auth0/ruby-auth0/deployments","created_at":"2014-06-20T19:26:07Z","updated_at":"2017-01-08T18:21:11Z","pushed_at":"2017-02-22T17:22:44Z","git_url":"git://github.com/auth0/ruby-auth0.git","ssh_url":"git@github.com:auth0/ruby-auth0.git","clone_url":"https://github.com/auth0/ruby-auth0.git","svn_url":"https://github.com/auth0/ruby-auth0","homepage":"https://auth0.com/","size":999,"stargazers_count":40,"watchers_count":40,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":7,"forks":46,"open_issues":7,"watchers":40,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/auth0/ruby-auth0/pulls/82"},"html":{"href":"https://github.com/auth0/ruby-auth0/pull/82"},"issue":{"href":"https://api.github.com/repos/auth0/ruby-auth0/issues/82"},"comments":{"href":"https://api.github.com/repos/auth0/ruby-auth0/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/auth0/ruby-auth0/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/auth0/ruby-auth0/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/auth0/ruby-auth0/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/auth0/ruby-auth0/statuses/fab6ab95a9a9b6ce137a857a3b288148f3c803b6"}}}}
{"actor":{"display_login":"leosoubeste"}}