{"action":"closed","issue":{"url":"https://api.github.com/repos/auth0/node-jsonwebtoken/issues/533","repository_url":"https://api.github.com/repos/auth0/node-jsonwebtoken","labels_url":"https://api.github.com/repos/auth0/node-jsonwebtoken/issues/533/labels{/name}","comments_url":"https://api.github.com/repos/auth0/node-jsonwebtoken/issues/533/comments","events_url":"https://api.github.com/repos/auth0/node-jsonwebtoken/issues/533/events","html_url":"https://github.com/auth0/node-jsonwebtoken/issues/533","id":369936307,"node_id":"MDU6SXNzdWUzNjk5MzYzMDc=","number":533,"title":"token/key pair verification work in the JWT.io debugger but not with node-jsonwbetoken","user":{"login":"owendall","id":10927,"node_id":"MDQ6VXNlcjEwOTI3","avatar_url":"https://avatars1.githubusercontent.com/u/10927?v=4","gravatar_id":"","url":"https://api.github.com/users/owendall","html_url":"https://github.com/owendall","followers_url":"https://api.github.com/users/owendall/followers","following_url":"https://api.github.com/users/owendall/following{/other_user}","gists_url":"https://api.github.com/users/owendall/gists{/gist_id}","starred_url":"https://api.github.com/users/owendall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owendall/subscriptions","organizations_url":"https://api.github.com/users/owendall/orgs","repos_url":"https://api.github.com/users/owendall/repos","events_url":"https://api.github.com/users/owendall/events{/privacy}","received_events_url":"https://api.github.com/users/owendall/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-14T19:41:40Z","updated_at":"2018-10-15T15:42:34Z","closed_at":"2018-10-15T15:42:33Z","author_association":"NONE","body":"This is very strange.\r\n\r\nSee Runkit. Also pasting here.  IS there some step in the debugger that I am not doing in this test code?\r\n\r\nhttps://runkit.com/owendall/5bc28965f7b84200120e6f04\r\n\r\n```javascript\r\nvar jwt = require(\"jsonwebtoken\")\r\n\r\n// HS256 \r\nvar token='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGl4LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHw1YmJjZmVhYjY4YTU2YzRjNTEzMjIyM2MiLCJhdWQiOlsiaHR0cHM6Ly90b3BpeC5pby90ZXN0Il0sImlhdCI6MTUzOTQ3NTQ5NSwiZXhwIjoxNTM5NDgyNjk1LCJhenAiOiJTaWNWUUlQRFJqQ2t2WVFFaTQ2bFNJWFhUeVllc1RJWCIsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUifQ.p9VPXiKqD4zFcKAoq112dV3FIyoHncAi0UytOJaPs2c';\r\n\r\n// This is the \"Signing Secret\" obtained from Auth0 for the test API\r\nvar key = 'cE9d0Vy07dFxD3SOnpiAYLwwkDno7ZB6';// This is the same key used in the JWT.io debugger that works there!!\r\n\r\n// Sync version: First try without specifying alg\r\ntry {\r\n var decoded = jwt.verify(token, key)\r\n} catch(err){\r\n  console.log(\"Verify: Sync test 1: \" +err.message);\r\n}\r\n\r\ntry {\r\n var decoded = jwt.verify(token, key, { algorithms: ['HS256'] })\r\n} catch(err){\r\n  console.log(\"Verify: Sync test 2: \" +err.message);\r\n}\r\n\r\n// Try async version\r\njwt.verify(token, key, function(err, decoded) {\r\n  if (!err) {\r\n  console.log('Verify: Async test 1: Audience decoded: ' +decoded.aud)\r\n  } else {\r\n  console.log(\"Verify: Async test 1: \"+ err.message);\r\n  }\r\n});\r\n\r\n// Now just decode without signature verification\r\ntry {\r\n  var decoded = jwt.decode(token,key);\r\n  console.log('Decode Only: Sync test: Audience decoded: '+ decoded.aud);\r\n} catch(err){\r\n  console.log(err.message);\r\n}\r\n```"}}
{"actor":{"display_login":"owendall"}}