{"action":"created","comment":{"url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/pulls/comments/43082568","id":43082568,"diff_hunk":"@@ -0,0 +1,39 @@\n+<?php\n+\n+\n+namespace Stormpath\\Oauth;","path":"src/Stormpath/Oauth/RefreshGrantAuthenticator.php","position":4,"original_position":4,"commit_id":"e2238a089690451b9f1284fcafe99497c95f4938","original_commit_id":"e2238a089690451b9f1284fcafe99497c95f4938","user":{"login":"Nitpick-CI","id":12626182,"avatar_url":"https://avatars.githubusercontent.com/u/12626182?v=3","gravatar_id":"","url":"https://api.github.com/users/Nitpick-CI","html_url":"https://github.com/Nitpick-CI","followers_url":"https://api.github.com/users/Nitpick-CI/followers","following_url":"https://api.github.com/users/Nitpick-CI/following{/other_user}","gists_url":"https://api.github.com/users/Nitpick-CI/gists{/gist_id}","starred_url":"https://api.github.com/users/Nitpick-CI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nitpick-CI/subscriptions","organizations_url":"https://api.github.com/users/Nitpick-CI/orgs","repos_url":"https://api.github.com/users/Nitpick-CI/repos","events_url":"https://api.github.com/users/Nitpick-CI/events{/privacy}","received_events_url":"https://api.github.com/users/Nitpick-CI/received_events","type":"User","site_admin":false},"body":"There must be one blank line after the namespace declaration","created_at":"2015-10-27T04:05:33Z","updated_at":"2015-10-27T04:05:33Z","html_url":"https://github.com/stormpath/stormpath-sdk-php/pull/97#discussion_r43082568","pull_request_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/pulls/97","_links":{"self":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-php/pulls/comments/43082568"},"html":{"href":"https://github.com/stormpath/stormpath-sdk-php/pull/97#discussion_r43082568"},"pull_request":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-php/pulls/97"}}},"pull_request":{"url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/pulls/97","id":48826509,"html_url":"https://github.com/stormpath/stormpath-sdk-php/pull/97","diff_url":"https://github.com/stormpath/stormpath-sdk-php/pull/97.diff","patch_url":"https://github.com/stormpath/stormpath-sdk-php/pull/97.patch","issue_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/issues/97","number":97,"state":"open","locked":false,"title":"Token Management","user":{"login":"bretterer","id":1906920,"avatar_url":"https://avatars.githubusercontent.com/u/1906920?v=3","gravatar_id":"","url":"https://api.github.com/users/bretterer","html_url":"https://github.com/bretterer","followers_url":"https://api.github.com/users/bretterer/followers","following_url":"https://api.github.com/users/bretterer/following{/other_user}","gists_url":"https://api.github.com/users/bretterer/gists{/gist_id}","starred_url":"https://api.github.com/users/bretterer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bretterer/subscriptions","organizations_url":"https://api.github.com/users/bretterer/orgs","repos_url":"https://api.github.com/users/bretterer/repos","events_url":"https://api.github.com/users/bretterer/events{/privacy}","received_events_url":"https://api.github.com/users/bretterer/received_events","type":"User","site_admin":false},"body":"This addresses #59 \r\n\r\nCode samples for Token management Guide ( @omgitstom )\r\n\r\n### Setting Oauth Policy\r\n```\r\n    $oauthPolicy = $application->oauthPolicy;\r\n    $oauthPolicy->accessTokenTtl = 'PT1H';\r\n    $oauthPolicy->refreshTokenTtl = 'P7D';\r\n    $oauthPolicy->save();\r\n```\r\n\r\n### Password Grant Type\r\n```\r\n   $passwordGrant = new \\Stormpath\\Oauth\\PasswordGrantRequest($_REQUEST['username'], $_REQUEST['password']);\r\n\r\n    $auth = new \\Stormpath\\Oauth\\PasswordGrantAuthenticator($application);\r\n    $result = $auth->authenticate($passwordGrant);\r\n```\r\n\r\n### Refresh Token Grant Type\r\n```\r\n    $refreshGrant = new \\Stormpath\\Oauth\\RefreshGrantRequest($_REQUEST['refresh_token']);\r\n\r\n    $auth = new \\Stormpath\\Oauth\\RefreshGrantAuthenticator($application);\r\n    $result = $auth->authenticate($refreshGrant);\r\n```\r\n\r\n### Validate JWT locally\r\n```\r\n   $expandedJwt = JWT::decode($jwt, $apiSecret, ['HS256']);\r\n```\r\n\r\n### Delete Token\r\n``` \r\n    $token = AccessToken::get($tokenHref);\r\n    $token->delete();\r\n```\r\n\r\n\r\n\r\n@ecrisostomo: this is ready for review\r\n","created_at":"2015-10-27T03:59:53Z","updated_at":"2015-10-27T04:05:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0fa6a55696cd3de1ec1d8f0db6576c33556d468c","assignee":{"login":"ecrisostomo","id":1820138,"avatar_url":"https://avatars.githubusercontent.com/u/1820138?v=3","gravatar_id":"","url":"https://api.github.com/users/ecrisostomo","html_url":"https://github.com/ecrisostomo","followers_url":"https://api.github.com/users/ecrisostomo/followers","following_url":"https://api.github.com/users/ecrisostomo/following{/other_user}","gists_url":"https://api.github.com/users/ecrisostomo/gists{/gist_id}","starred_url":"https://api.github.com/users/ecrisostomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecrisostomo/subscriptions","organizations_url":"https://api.github.com/users/ecrisostomo/orgs","repos_url":"https://api.github.com/users/ecrisostomo/repos","events_url":"https://api.github.com/users/ecrisostomo/events{/privacy}","received_events_url":"https://api.github.com/users/ecrisostomo/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/milestones/12","html_url":"https://github.com/stormpath/stormpath-sdk-php/milestones/Version%201.11.0.beta","labels_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/milestones/12/labels","id":1284755,"number":12,"title":"Version 1.11.0.beta","description":"","creator":{"login":"bretterer","id":1906920,"avatar_url":"https://avatars.githubusercontent.com/u/1906920?v=3","gravatar_id":"","url":"https://api.github.com/users/bretterer","html_url":"https://github.com/bretterer","followers_url":"https://api.github.com/users/bretterer/followers","following_url":"https://api.github.com/users/bretterer/following{/other_user}","gists_url":"https://api.github.com/users/bretterer/gists{/gist_id}","starred_url":"https://api.github.com/users/bretterer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bretterer/subscriptions","organizations_url":"https://api.github.com/users/bretterer/orgs","repos_url":"https://api.github.com/users/bretterer/repos","events_url":"https://api.github.com/users/bretterer/events{/privacy}","received_events_url":"https://api.github.com/users/bretterer/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":3,"state":"open","created_at":"2015-09-01T19:51:28Z","updated_at":"2015-10-27T03:59:53Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/pulls/97/commits","review_comments_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/pulls/97/comments","review_comment_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/issues/97/comments","statuses_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/statuses/e2238a089690451b9f1284fcafe99497c95f4938","head":{"label":"stormpath:feature/Token_Management_Issue_59","ref":"feature/Token_Management_Issue_59","sha":"e2238a089690451b9f1284fcafe99497c95f4938","user":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"repo":{"id":5237662,"name":"stormpath-sdk-php","full_name":"stormpath/stormpath-sdk-php","owner":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stormpath/stormpath-sdk-php","description":"PHP SDK for the Stormpath User Management and Authentication REST+JSON API","fork":false,"url":"https://api.github.com/repos/stormpath/stormpath-sdk-php","forks_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/forks","keys_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/teams","hooks_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/hooks","issue_events_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/issues/events{/number}","events_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/events","assignees_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/assignees{/user}","branches_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/branches{/branch}","tags_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/tags","blobs_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/statuses/{sha}","languages_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/languages","stargazers_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/stargazers","contributors_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/contributors","subscribers_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/subscribers","subscription_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/subscription","commits_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/contents/{+path}","compare_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/merges","archive_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/downloads","issues_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/issues{/number}","pulls_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/pulls{/number}","milestones_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/milestones{/number}","notifications_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/labels{/name}","releases_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/releases{/id}","created_at":"2012-07-30T20:47:09Z","updated_at":"2015-10-19T07:48:35Z","pushed_at":"2015-10-27T04:05:29Z","git_url":"git://github.com/stormpath/stormpath-sdk-php.git","ssh_url":"git@github.com:stormpath/stormpath-sdk-php.git","clone_url":"https://github.com/stormpath/stormpath-sdk-php.git","svn_url":"https://github.com/stormpath/stormpath-sdk-php","homepage":"","size":1706,"stargazers_count":33,"watchers_count":33,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":15,"forks":23,"open_issues":15,"watchers":33,"default_branch":"master"}},"base":{"label":"stormpath:dev","ref":"dev","sha":"b155c92065c9168ef13415a11249011072015eed","user":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"repo":{"id":5237662,"name":"stormpath-sdk-php","full_name":"stormpath/stormpath-sdk-php","owner":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stormpath/stormpath-sdk-php","description":"PHP SDK for the Stormpath User Management and Authentication REST+JSON API","fork":false,"url":"https://api.github.com/repos/stormpath/stormpath-sdk-php","forks_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/forks","keys_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/teams","hooks_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/hooks","issue_events_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/issues/events{/number}","events_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/events","assignees_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/assignees{/user}","branches_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/branches{/branch}","tags_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/tags","blobs_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/statuses/{sha}","languages_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/languages","stargazers_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/stargazers","contributors_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/contributors","subscribers_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/subscribers","subscription_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/subscription","commits_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/contents/{+path}","compare_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/merges","archive_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/downloads","issues_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/issues{/number}","pulls_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/pulls{/number}","milestones_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/milestones{/number}","notifications_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/labels{/name}","releases_url":"https://api.github.com/repos/stormpath/stormpath-sdk-php/releases{/id}","created_at":"2012-07-30T20:47:09Z","updated_at":"2015-10-19T07:48:35Z","pushed_at":"2015-10-27T04:05:29Z","git_url":"git://github.com/stormpath/stormpath-sdk-php.git","ssh_url":"git@github.com:stormpath/stormpath-sdk-php.git","clone_url":"https://github.com/stormpath/stormpath-sdk-php.git","svn_url":"https://github.com/stormpath/stormpath-sdk-php","homepage":"","size":1706,"stargazers_count":33,"watchers_count":33,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":15,"forks":23,"open_issues":15,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-php/pulls/97"},"html":{"href":"https://github.com/stormpath/stormpath-sdk-php/pull/97"},"issue":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-php/issues/97"},"comments":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-php/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-php/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-php/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-php/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/stormpath/stormpath-sdk-php/statuses/e2238a089690451b9f1284fcafe99497c95f4938"}}}}