{"action":"created","issue":{"url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/764","repository_url":"https://api.github.com/repos/tymondesigns/jwt-auth","labels_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/764/labels{/name}","comments_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/764/comments","events_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/764/events","html_url":"https://github.com/tymondesigns/jwt-auth/issues/764","id":160853305,"number":764,"title":"Exception when trying to create a token with a custom payload","user":{"login":"SeBuDesign","id":1454452,"avatar_url":"https://avatars.githubusercontent.com/u/1454452?v=3","gravatar_id":"","url":"https://api.github.com/users/SeBuDesign","html_url":"https://github.com/SeBuDesign","followers_url":"https://api.github.com/users/SeBuDesign/followers","following_url":"https://api.github.com/users/SeBuDesign/following{/other_user}","gists_url":"https://api.github.com/users/SeBuDesign/gists{/gist_id}","starred_url":"https://api.github.com/users/SeBuDesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeBuDesign/subscriptions","organizations_url":"https://api.github.com/users/SeBuDesign/orgs","repos_url":"https://api.github.com/users/SeBuDesign/repos","events_url":"https://api.github.com/users/SeBuDesign/events{/privacy}","received_events_url":"https://api.github.com/users/SeBuDesign/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-06-17T09:58:39Z","updated_at":"2016-06-17T17:04:44Z","closed_at":"2016-06-17T10:33:43Z","body":"Hi all,\r\n\r\nI think I've found a bug in the 0.5.10 version of this package. With the 0.5.9 version I am able to create a token with a custom payload. The code is like this:\r\n\r\n```php\r\n$payload = JWTFactory::make(SessionHelper::getBearerPayload());\r\n```\r\n\r\nWith 0.5.9 this works just fine but with 0.5.10 I get the following exception: `JWT payload does not contain the required claims`\r\n\r\nThe data I wish to put into the token is:\r\n```php\r\narray:1 [\r\n  \"session-id\" => \"session:5763c8e425805\"\r\n]\r\n```\r\n\r\nI changed my composer.json to use the 0.5.9 package for now but it would be nice to have this functionality made available again.\r\n\r\nAny ideas why this issue occurs?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/comments/226825197","html_url":"https://github.com/tymondesigns/jwt-auth/issues/764#issuecomment-226825197","issue_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/764","id":226825197,"user":{"login":"tdhsmith","id":1791252,"avatar_url":"https://avatars.githubusercontent.com/u/1791252?v=3","gravatar_id":"","url":"https://api.github.com/users/tdhsmith","html_url":"https://github.com/tdhsmith","followers_url":"https://api.github.com/users/tdhsmith/followers","following_url":"https://api.github.com/users/tdhsmith/following{/other_user}","gists_url":"https://api.github.com/users/tdhsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/tdhsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdhsmith/subscriptions","organizations_url":"https://api.github.com/users/tdhsmith/orgs","repos_url":"https://api.github.com/users/tdhsmith/repos","events_url":"https://api.github.com/users/tdhsmith/events{/privacy}","received_events_url":"https://api.github.com/users/tdhsmith/received_events","type":"User","site_admin":false},"created_at":"2016-06-17T17:04:44Z","updated_at":"2016-06-17T17:04:44Z","body":"@SeBuDesign It looks like your payload doesn't contain a subject claim, which is in the default required claims list. If you are not using subjects in your tokens, simply remove the `sub` entry from the `jwt.required_claims` config.\r\n\r\n(Before 0.5.10, not having a subject would incorrectly pass the test as long as you had at least one custom claim, which is why you'd first see the message now.)"}}
{"actor":{"display_login":"tdhsmith"}}