{"action":"opened","issue":{"url":"https://api.github.com/repos/potatosalad/erlang-jose/issues/5","labels_url":"https://api.github.com/repos/potatosalad/erlang-jose/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/potatosalad/erlang-jose/issues/5/comments","events_url":"https://api.github.com/repos/potatosalad/erlang-jose/issues/5/events","html_url":"https://github.com/potatosalad/erlang-jose/issues/5","id":101639798,"number":5,"title":"Poison encoding/decoding","user":{"login":"cs-victor-nascimento","id":7049728,"avatar_url":"https://avatars.githubusercontent.com/u/7049728?v=3","gravatar_id":"","url":"https://api.github.com/users/cs-victor-nascimento","html_url":"https://github.com/cs-victor-nascimento","followers_url":"https://api.github.com/users/cs-victor-nascimento/followers","following_url":"https://api.github.com/users/cs-victor-nascimento/following{/other_user}","gists_url":"https://api.github.com/users/cs-victor-nascimento/gists{/gist_id}","starred_url":"https://api.github.com/users/cs-victor-nascimento/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cs-victor-nascimento/subscriptions","organizations_url":"https://api.github.com/users/cs-victor-nascimento/orgs","repos_url":"https://api.github.com/users/cs-victor-nascimento/repos","events_url":"https://api.github.com/users/cs-victor-nascimento/events{/privacy}","received_events_url":"https://api.github.com/users/cs-victor-nascimento/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-18T11:58:37Z","updated_at":"2015-08-18T11:58:37Z","closed_at":null,"body":"Hey @potatosalad!\r\n\r\nI've been testing your encoding/decoding with Poison and am running into some issues. I have this simple token (which is valid according to jwt.io and was generate with erlang-jose. It is an HS256 with \"secret\" as its key):\r\n\r\n```elixir\r\ntoken = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiSm9obiBEb2UifQ.xuEv8qrfXu424LZk8bVgr9MQJUIrp1rHcPyZw_KSsds\"\r\n```\r\n\r\nBut when I try this on iex:\r\n\r\n```elixir\r\nJOSE.json_module Poison\r\nJOSE.JWK.verify token, \"secret\"\r\n```\r\n\r\nI get a nasty Poison error:\r\n\r\n```elixir\r\n** (Poison.SyntaxError) Unexpected token: s\r\n    (poison) lib/poison/parser.ex:56: Poison.Parser.parse!/2\r\n    (poison) lib/poison.ex:83: Poison.decode!/2\r\n      (jose) src/jose_jwk.erl:120: :jose_jwk.from_binary/1\r\n      (jose) src/jose_jwk.erl:429: :jose_jwk.verify/2\r\n      (jose) lib/jose/jwk.ex:141: JOSE.JWK.verify/2\r\n```\r\n\r\nI verified that I can decode both base64url decoded parts of the token using `:jose.decode(binary)`. "}}