{"action":"created","comment":{"url":"https://api.github.com/repos/box/box-node-sdk/pulls/comments/79608573","id":79608573,"diff_hunk":"@@ -104,3 +104,47 @@ var sdk = new BoxSDK({\n });\n var adminClient = sdk.getAppAuthClient('enterprise', 'YOUR-ENTERPRISE-ID');\n ```\n+\n+### JSON Web Token Enterprise Authentication\n+\n+For machine-to-machine use cases, such as applications that use Box services for\n+back-end storage, but which provide their own user-inteface, Box extends OAuth 2\n+with JSON Web Tokens (JWT). Authentication using JWT enables your application\n+to authenticate itself directly to Box without needing to display any Box user\n+interface elements. See the [Authentication with JWT](https://docs.box.com/docs/app-auth)\n+for detailed instructions on how to use JWT auth.\n+\n+```js\n+var BoxSDK = require('box-node-sdk');\n+var sdk = new BoxSDK({\n+\tclientID: 'YOUR-CLIENT-ID',\n+\tclientSecret: 'YOUR-CLIENT_SECRET',\n+\tappAuth: {\n+\t\tkeyID: 'YOUR-KEY-ID',\n+\t\tprivateKey: 'YOUR-PRIVATE_KEY',\n+\t\tpassphrase: 'YOUR-PRIVATE-KEY-PASSPHRASE'\n+\t}\n+});\n+var adminClient = sdk.getEnterpriseAppAuthTokens('YOUR-ENTERPRISE-ID', callback);\n+```\n+\n+### JSON Web Token User Authentication\n+\n+Once you have enterprise token, you can create App user and then perform\n+user-specific actions. See the [Creating App Users and Managing Your Enterprise](https://docs.box.com/docs/app-auth#section-creating-app-users-and-managing-your-enterprise)","path":"docs/authentication.md","position":31,"original_position":31,"commit_id":"214e64a826844548b1561aa24a083825b85ecfa7","original_commit_id":"214e64a826844548b1561aa24a083825b85ecfa7","user":{"login":"Trudko","id":3289225,"avatar_url":"https://avatars.githubusercontent.com/u/3289225?v=3","gravatar_id":"","url":"https://api.github.com/users/Trudko","html_url":"https://github.com/Trudko","followers_url":"https://api.github.com/users/Trudko/followers","following_url":"https://api.github.com/users/Trudko/following{/other_user}","gists_url":"https://api.github.com/users/Trudko/gists{/gist_id}","starred_url":"https://api.github.com/users/Trudko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Trudko/subscriptions","organizations_url":"https://api.github.com/users/Trudko/orgs","repos_url":"https://api.github.com/users/Trudko/repos","events_url":"https://api.github.com/users/Trudko/events{/privacy}","received_events_url":"https://api.github.com/users/Trudko/received_events","type":"User","site_admin":false},"body":"Goal to provide information about relationship between Enterprise user and Application user. Especially that you need to first get enterprise token to receive user id in order to be able to perform user specific action. When I was working with SDK I first used developer token , which obviously works differently than JWT so I had to go back to documentation to look for closer explanation. ","created_at":"2016-09-20T13:23:28Z","updated_at":"2016-09-20T13:23:28Z","html_url":"https://github.com/box/box-node-sdk/pull/21#discussion_r79608573","pull_request_url":"https://api.github.com/repos/box/box-node-sdk/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/box/box-node-sdk/pulls/comments/79608573"},"html":{"href":"https://github.com/box/box-node-sdk/pull/21#discussion_r79608573"},"pull_request":{"href":"https://api.github.com/repos/box/box-node-sdk/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/box/box-node-sdk/pulls/21","id":85798444,"html_url":"https://github.com/box/box-node-sdk/pull/21","diff_url":"https://github.com/box/box-node-sdk/pull/21.diff","patch_url":"https://github.com/box/box-node-sdk/pull/21.patch","issue_url":"https://api.github.com/repos/box/box-node-sdk/issues/21","number":21,"state":"open","locked":false,"title":"JWT documentation","user":{"login":"Trudko","id":3289225,"avatar_url":"https://avatars.githubusercontent.com/u/3289225?v=3","gravatar_id":"","url":"https://api.github.com/users/Trudko","html_url":"https://github.com/Trudko","followers_url":"https://api.github.com/users/Trudko/followers","following_url":"https://api.github.com/users/Trudko/following{/other_user}","gists_url":"https://api.github.com/users/Trudko/gists{/gist_id}","starred_url":"https://api.github.com/users/Trudko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Trudko/subscriptions","organizations_url":"https://api.github.com/users/Trudko/orgs","repos_url":"https://api.github.com/users/Trudko/repos","events_url":"https://api.github.com/users/Trudko/events{/privacy}","received_events_url":"https://api.github.com/users/Trudko/received_events","type":"User","site_admin":false},"body":"Documentation for enterprise and app user authentication.","created_at":"2016-09-19T13:58:58Z","updated_at":"2016-09-20T13:23:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f300078b433eee6e42ee57db7c63cf3342297200","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/box/box-node-sdk/pulls/21/commits","review_comments_url":"https://api.github.com/repos/box/box-node-sdk/pulls/21/comments","review_comment_url":"https://api.github.com/repos/box/box-node-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/box/box-node-sdk/issues/21/comments","statuses_url":"https://api.github.com/repos/box/box-node-sdk/statuses/214e64a826844548b1561aa24a083825b85ecfa7","head":{"label":"Trudko:jwt","ref":"jwt","sha":"214e64a826844548b1561aa24a083825b85ecfa7","user":{"login":"Trudko","id":3289225,"avatar_url":"https://avatars.githubusercontent.com/u/3289225?v=3","gravatar_id":"","url":"https://api.github.com/users/Trudko","html_url":"https://github.com/Trudko","followers_url":"https://api.github.com/users/Trudko/followers","following_url":"https://api.github.com/users/Trudko/following{/other_user}","gists_url":"https://api.github.com/users/Trudko/gists{/gist_id}","starred_url":"https://api.github.com/users/Trudko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Trudko/subscriptions","organizations_url":"https://api.github.com/users/Trudko/orgs","repos_url":"https://api.github.com/users/Trudko/repos","events_url":"https://api.github.com/users/Trudko/events{/privacy}","received_events_url":"https://api.github.com/users/Trudko/received_events","type":"User","site_admin":false},"repo":{"id":68008409,"name":"box-node-sdk","full_name":"Trudko/box-node-sdk","owner":{"login":"Trudko","id":3289225,"avatar_url":"https://avatars.githubusercontent.com/u/3289225?v=3","gravatar_id":"","url":"https://api.github.com/users/Trudko","html_url":"https://github.com/Trudko","followers_url":"https://api.github.com/users/Trudko/followers","following_url":"https://api.github.com/users/Trudko/following{/other_user}","gists_url":"https://api.github.com/users/Trudko/gists{/gist_id}","starred_url":"https://api.github.com/users/Trudko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Trudko/subscriptions","organizations_url":"https://api.github.com/users/Trudko/orgs","repos_url":"https://api.github.com/users/Trudko/repos","events_url":"https://api.github.com/users/Trudko/events{/privacy}","received_events_url":"https://api.github.com/users/Trudko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Trudko/box-node-sdk","description":"A Javascript interface for interacting with the Box API. You can find the node package at","fork":true,"url":"https://api.github.com/repos/Trudko/box-node-sdk","forks_url":"https://api.github.com/repos/Trudko/box-node-sdk/forks","keys_url":"https://api.github.com/repos/Trudko/box-node-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Trudko/box-node-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Trudko/box-node-sdk/teams","hooks_url":"https://api.github.com/repos/Trudko/box-node-sdk/hooks","issue_events_url":"https://api.github.com/repos/Trudko/box-node-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/Trudko/box-node-sdk/events","assignees_url":"https://api.github.com/repos/Trudko/box-node-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/Trudko/box-node-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/Trudko/box-node-sdk/tags","blobs_url":"https://api.github.com/repos/Trudko/box-node-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Trudko/box-node-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Trudko/box-node-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/Trudko/box-node-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Trudko/box-node-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/Trudko/box-node-sdk/languages","stargazers_url":"https://api.github.com/repos/Trudko/box-node-sdk/stargazers","contributors_url":"https://api.github.com/repos/Trudko/box-node-sdk/contributors","subscribers_url":"https://api.github.com/repos/Trudko/box-node-sdk/subscribers","subscription_url":"https://api.github.com/repos/Trudko/box-node-sdk/subscription","commits_url":"https://api.github.com/repos/Trudko/box-node-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/Trudko/box-node-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/Trudko/box-node-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/Trudko/box-node-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/Trudko/box-node-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/Trudko/box-node-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Trudko/box-node-sdk/merges","archive_url":"https://api.github.com/repos/Trudko/box-node-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Trudko/box-node-sdk/downloads","issues_url":"https://api.github.com/repos/Trudko/box-node-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/Trudko/box-node-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/Trudko/box-node-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/Trudko/box-node-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Trudko/box-node-sdk/labels{/name}","releases_url":"https://api.github.com/repos/Trudko/box-node-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/Trudko/box-node-sdk/deployments","created_at":"2016-09-12T12:49:57Z","updated_at":"2016-09-12T12:49:58Z","pushed_at":"2016-09-20T12:33:48Z","git_url":"git://github.com/Trudko/box-node-sdk.git","ssh_url":"git@github.com:Trudko/box-node-sdk.git","clone_url":"https://github.com/Trudko/box-node-sdk.git","svn_url":"https://github.com/Trudko/box-node-sdk","homepage":"https://www.npmjs.com/package/box-node-sdk","size":725,"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":"box:master","ref":"master","sha":"00f66f99710417ffec5ea2d585139e3147685172","user":{"login":"box","id":23900,"avatar_url":"https://avatars.githubusercontent.com/u/23900?v=3","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"repo":{"id":60120242,"name":"box-node-sdk","full_name":"box/box-node-sdk","owner":{"login":"box","id":23900,"avatar_url":"https://avatars.githubusercontent.com/u/23900?v=3","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/box/box-node-sdk","description":"A Javascript interface for interacting with the Box API. You can find the node package at","fork":false,"url":"https://api.github.com/repos/box/box-node-sdk","forks_url":"https://api.github.com/repos/box/box-node-sdk/forks","keys_url":"https://api.github.com/repos/box/box-node-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/box/box-node-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/box/box-node-sdk/teams","hooks_url":"https://api.github.com/repos/box/box-node-sdk/hooks","issue_events_url":"https://api.github.com/repos/box/box-node-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/box/box-node-sdk/events","assignees_url":"https://api.github.com/repos/box/box-node-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/box/box-node-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/box/box-node-sdk/tags","blobs_url":"https://api.github.com/repos/box/box-node-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/box/box-node-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/box/box-node-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/box/box-node-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/box/box-node-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/box/box-node-sdk/languages","stargazers_url":"https://api.github.com/repos/box/box-node-sdk/stargazers","contributors_url":"https://api.github.com/repos/box/box-node-sdk/contributors","subscribers_url":"https://api.github.com/repos/box/box-node-sdk/subscribers","subscription_url":"https://api.github.com/repos/box/box-node-sdk/subscription","commits_url":"https://api.github.com/repos/box/box-node-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/box/box-node-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/box/box-node-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/box/box-node-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/box/box-node-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/box/box-node-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/box/box-node-sdk/merges","archive_url":"https://api.github.com/repos/box/box-node-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/box/box-node-sdk/downloads","issues_url":"https://api.github.com/repos/box/box-node-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/box/box-node-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/box/box-node-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/box/box-node-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/box/box-node-sdk/labels{/name}","releases_url":"https://api.github.com/repos/box/box-node-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/box/box-node-sdk/deployments","created_at":"2016-05-31T20:14:17Z","updated_at":"2016-09-16T22:52:17Z","pushed_at":"2016-09-20T12:33:48Z","git_url":"git://github.com/box/box-node-sdk.git","ssh_url":"git@github.com:box/box-node-sdk.git","clone_url":"https://github.com/box/box-node-sdk.git","svn_url":"https://github.com/box/box-node-sdk","homepage":"https://www.npmjs.com/package/box-node-sdk","size":735,"stargazers_count":26,"watchers_count":26,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":11,"forks":7,"open_issues":11,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/box/box-node-sdk/pulls/21"},"html":{"href":"https://github.com/box/box-node-sdk/pull/21"},"issue":{"href":"https://api.github.com/repos/box/box-node-sdk/issues/21"},"comments":{"href":"https://api.github.com/repos/box/box-node-sdk/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/box/box-node-sdk/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/box/box-node-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/box/box-node-sdk/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/box/box-node-sdk/statuses/214e64a826844548b1561aa24a083825b85ecfa7"}}}}
{"actor":{"display_login":"Trudko"}}