{"action":"created","issue":{"url":"https://api.github.com/repos/kelvinmo/simplejwt/issues/5","repository_url":"https://api.github.com/repos/kelvinmo/simplejwt","labels_url":"https://api.github.com/repos/kelvinmo/simplejwt/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/kelvinmo/simplejwt/issues/5/comments","events_url":"https://api.github.com/repos/kelvinmo/simplejwt/issues/5/events","html_url":"https://github.com/kelvinmo/simplejwt/issues/5","id":304458805,"number":5,"title":"$set variable does not have key","user":{"login":"oadekoya12","id":9222760,"avatar_url":"https://avatars3.githubusercontent.com/u/9222760?v=4","gravatar_id":"","url":"https://api.github.com/users/oadekoya12","html_url":"https://github.com/oadekoya12","followers_url":"https://api.github.com/users/oadekoya12/followers","following_url":"https://api.github.com/users/oadekoya12/following{/other_user}","gists_url":"https://api.github.com/users/oadekoya12/gists{/gist_id}","starred_url":"https://api.github.com/users/oadekoya12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oadekoya12/subscriptions","organizations_url":"https://api.github.com/users/oadekoya12/orgs","repos_url":"https://api.github.com/users/oadekoya12/repos","events_url":"https://api.github.com/users/oadekoya12/events{/privacy}","received_events_url":"https://api.github.com/users/oadekoya12/received_events","type":"User","site_admin":false},"labels":[{"id":235196207,"url":"https://api.github.com/repos/kelvinmo/simplejwt/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-03-12T17:03:07Z","updated_at":"2018-03-27T08:34:35Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\nI am using the example the [readme](https://github.com/kelvinmo/simplejwt).\r\nFor some reason when I want to verify my sign token and getting the following error:\r\n\r\n> SimpleJWT\\InvalidTokenException: Key not found or is invalid in SimpleJWT\\JWT::decode() \r\n```php\r\n$set = new SimpleJWT\\Keys\\KeySet();\r\n  $key_private = new SimpleJWT\\Keys\\RSAKey(file_get_contents([part to the private key]/key.pem', true), 'pem');\r\n$set->add($key_private);\r\n$headers = array('alg' => 'RS256', 'typ' => 'JWT');\r\n$claims = array(\"iss\" => \"joe\", \"exp\" => 1300819380, \"http://example.com/is_root\" => true); //for example\r\n$jwt_hc= new SimpleJWT\\JWT($headers, $claims);\r\n$jwt = $jwt_hc->encode($set);\r\n$jwt_decode = SimpleJWT\\JWT::decode($jwt, $set, 'RS256');\r\n```\r\n\r\nPlease I need help."},"comment":{"url":"https://api.github.com/repos/kelvinmo/simplejwt/issues/comments/376442119","html_url":"https://github.com/kelvinmo/simplejwt/issues/5#issuecomment-376442119","issue_url":"https://api.github.com/repos/kelvinmo/simplejwt/issues/5","id":376442119,"user":{"login":"kelvinmo","id":1594601,"avatar_url":"https://avatars0.githubusercontent.com/u/1594601?v=4","gravatar_id":"","url":"https://api.github.com/users/kelvinmo","html_url":"https://github.com/kelvinmo","followers_url":"https://api.github.com/users/kelvinmo/followers","following_url":"https://api.github.com/users/kelvinmo/following{/other_user}","gists_url":"https://api.github.com/users/kelvinmo/gists{/gist_id}","starred_url":"https://api.github.com/users/kelvinmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kelvinmo/subscriptions","organizations_url":"https://api.github.com/users/kelvinmo/orgs","repos_url":"https://api.github.com/users/kelvinmo/repos","events_url":"https://api.github.com/users/kelvinmo/events{/privacy}","received_events_url":"https://api.github.com/users/kelvinmo/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T08:34:35Z","updated_at":"2018-03-27T08:34:35Z","author_association":"OWNER","body":"A few things which may help.\r\n\r\nFirstly, you may want to check whether the keys you are getting are public keys.  Try:\r\n\r\n```php\r\nforeach ($remote_key->getKeys() as $key) {\r\n    print $key->isPublic();\r\n}\r\n```\r\n\r\nIf the function comes out as false, then you have a horrible situation of someone placing their private keys online.\r\n\r\nSecondly, if $remote_set contains multiple RSA keys, you will need to specify which one of those keys should be used to verify the signature, using the $kid parameter in the decode function.  Otherwise it will choose the one that matches the kid claim in the JWT or if that doesn't exist, the first RSA key in $remote_set.\r\n\r\nThirdly, check that the openssl module in php is working.  Try running the test suite in the tests directory using phpunit."}}
{"actor":{"display_login":"kelvinmo"}}