{"action":"created","issue":{"url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/763","repository_url":"https://api.github.com/repos/tymondesigns/jwt-auth","labels_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/763/labels{/name}","comments_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/763/comments","events_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/763/events","html_url":"https://github.com/tymondesigns/jwt-auth/issues/763","id":160822077,"number":763,"title":"JWTException when trying to use RS256 algorithm","user":{"login":"righter","id":1621194,"avatar_url":"https://avatars.githubusercontent.com/u/1621194?v=3","gravatar_id":"","url":"https://api.github.com/users/righter","html_url":"https://github.com/righter","followers_url":"https://api.github.com/users/righter/followers","following_url":"https://api.github.com/users/righter/following{/other_user}","gists_url":"https://api.github.com/users/righter/gists{/gist_id}","starred_url":"https://api.github.com/users/righter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/righter/subscriptions","organizations_url":"https://api.github.com/users/righter/orgs","repos_url":"https://api.github.com/users/righter/repos","events_url":"https://api.github.com/users/righter/events{/privacy}","received_events_url":"https://api.github.com/users/righter/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-06-17T06:41:41Z","updated_at":"2016-11-15T21:22:58Z","closed_at":"2016-07-08T09:56:04Z","body":"In order to successfully sign and verify tokens using RS256, I had to override a few methods in `Tymon\\JWTAuth\\Providers\\JWT\\Namshi`.\nHere's what I have set up:\n- I'm working from a fresh Laravel 5.2 installation\n- I installed tymon/jwt-auth, 1.0.0-alpha.2\n- JWT_PUBLIC_KEY=/tmp/jwt_auth/pubkey.pem\n- JWT_PRIVATE_KEY=/tmp/jwt_auth/privkey.pem\n- JWT_ALGO=RS256\n\nI'm authenticating a user like this:\n\n``` php\n    public function authUser(JWTAuth $jwt)\n    {\n        return $jwt->attempt(['email' => 'foo', 'password' => 'password']);\n    }\n```\n\nwhich results in the following error:\n\n```\nJWTException in Namshi.php line 61:\nCould not create token: openssl_pkey_get_details() expects parameter 1 to be resource, boolean given\n```\n\nLooking at the tests on the develop branch, the NamshiTest is using `file_get_contents` to get the file contents into a resource.\n\nTo keep changes out of the vendor directory, I created a new provider which extends `Tymon\\JWTAuth\\Providers\\JWT\\Namshi`. This allowed me to override the methods I needed and I was able to successfully authenticate users and receive/verify signed tokens.\n"},"comment":{"url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/comments/260772709","html_url":"https://github.com/tymondesigns/jwt-auth/issues/763#issuecomment-260772709","issue_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/763","id":260772709,"user":{"login":"JCarlosR","id":3101238,"avatar_url":"https://avatars.githubusercontent.com/u/3101238?v=3","gravatar_id":"","url":"https://api.github.com/users/JCarlosR","html_url":"https://github.com/JCarlosR","followers_url":"https://api.github.com/users/JCarlosR/followers","following_url":"https://api.github.com/users/JCarlosR/following{/other_user}","gists_url":"https://api.github.com/users/JCarlosR/gists{/gist_id}","starred_url":"https://api.github.com/users/JCarlosR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JCarlosR/subscriptions","organizations_url":"https://api.github.com/users/JCarlosR/orgs","repos_url":"https://api.github.com/users/JCarlosR/repos","events_url":"https://api.github.com/users/JCarlosR/events{/privacy}","received_events_url":"https://api.github.com/users/JCarlosR/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T21:22:58Z","updated_at":"2016-11-15T21:22:58Z","body":"Hi. Sorry if my next doubt is too strange, but I am new using JWT.\r\nI'm trying to authenticate a user in Firebase using the credentials of my Laravel app.\r\nAccording with this tutorial: https://firebase.google.com/docs/auth/server?hl=es\r\nI have to create a JWT with custom parameters. I did that, and the token is generated.\r\nBut the last step is change the algorithm to RS256. **To use RS256 is neccesary to have always two passwords?**\r\nI just have a private_key from the firebase console."}}
{"actor":{"display_login":"JCarlosR"}}