{"action":"created","issue":{"url":"https://api.github.com/repos/twilio/twilio-node/issues/193","repository_url":"https://api.github.com/repos/twilio/twilio-node","labels_url":"https://api.github.com/repos/twilio/twilio-node/issues/193/labels{/name}","comments_url":"https://api.github.com/repos/twilio/twilio-node/issues/193/comments","events_url":"https://api.github.com/repos/twilio/twilio-node/issues/193/events","html_url":"https://github.com/twilio/twilio-node/issues/193","id":174890727,"number":193,"title":"Cannot read property 'length' of undefined","user":{"login":"newtriks","id":31971,"avatar_url":"https://avatars.githubusercontent.com/u/31971?v=3","gravatar_id":"","url":"https://api.github.com/users/newtriks","html_url":"https://github.com/newtriks","followers_url":"https://api.github.com/users/newtriks/followers","following_url":"https://api.github.com/users/newtriks/following{/other_user}","gists_url":"https://api.github.com/users/newtriks/gists{/gist_id}","starred_url":"https://api.github.com/users/newtriks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newtriks/subscriptions","organizations_url":"https://api.github.com/users/newtriks/orgs","repos_url":"https://api.github.com/users/newtriks/repos","events_url":"https://api.github.com/users/newtriks/events{/privacy}","received_events_url":"https://api.github.com/users/newtriks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-03T10:36:42Z","updated_at":"2016-12-05T15:22:25Z","closed_at":null,"body":"It would appear that the JWT object generated by this library does not include a `scope` key/value which is expected by the JS SDK for setup? \n\n**Version:**\n**API Subdomain (api/taskrouter/ip_messaging):**\n\nTwilio: `2.10.0`\nJS: `media.twiliocdn.com/sdk/js/client/v1.3/twilio.js`\n### Code Snippet\n\n``` javascript\nvar accountSid = 'AC***';\nvar apiKeySid = 'SK***';\nvar apiKeySecret = '***';\nvar serviceSid = 'IS***';\nvar identity = 'user@example.com';\n\nconst token = new AccessToken(apiKeySid, accountSid, apiKeySecret);\nconst endpointId = 'ip-messaging-demo:' + identity + ':demo-device';\n\nconst ipmGrant = new IpMessagingGrant({\n  serviceSid: serviceSid,\n  endpointId: endpointId\n});\n\n\ntoken.addGrant(ipmGrant);\ntoken.identity = identity;\n\nconsole.log(token.toJwt());\n```\n### Exception / Log\n\n```\ntwilio.js:3933 Uncaught TypeError: Cannot read property 'length' of undefined\n\n  objectize @ twilio.js:3933\n  (anonymous function) @ twilio.js:3839\n  Device @ twilio.js:786\n  setup @ twilio.js:1249\n  handleToken @ (index):21\n  o @ jquery.min.js:2\n  fireWith @ jquery.min.js:2\n  w @ jquery.min.js:4\n  d @ jquery.min.js:4\n```\n\n<img width=\"638\" alt=\"screen shot 2016-09-03 at 08 16 25\" src=\"https://cloud.githubusercontent.com/assets/31971/18224330/6da9d5e0-71c9-11e6-92b3-0c4629abe9e1.png\">\n### Steps to Reproduce\n1. Generate token using above steps with `twilio-node` library. \n2. Confirm token in UI and run `Twilio.Device.setup(token);` (JWT signature verified using: https://jwt.io).\n3. Generates error above.\n"},"comment":{"url":"https://api.github.com/repos/twilio/twilio-node/issues/comments/264881860","html_url":"https://github.com/twilio/twilio-node/issues/193#issuecomment-264881860","issue_url":"https://api.github.com/repos/twilio/twilio-node/issues/193","id":264881860,"user":{"login":"katafractari","id":1299228,"avatar_url":"https://avatars.githubusercontent.com/u/1299228?v=3","gravatar_id":"","url":"https://api.github.com/users/katafractari","html_url":"https://github.com/katafractari","followers_url":"https://api.github.com/users/katafractari/followers","following_url":"https://api.github.com/users/katafractari/following{/other_user}","gists_url":"https://api.github.com/users/katafractari/gists{/gist_id}","starred_url":"https://api.github.com/users/katafractari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katafractari/subscriptions","organizations_url":"https://api.github.com/users/katafractari/orgs","repos_url":"https://api.github.com/users/katafractari/repos","events_url":"https://api.github.com/users/katafractari/events{/privacy}","received_events_url":"https://api.github.com/users/katafractari/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T15:22:25Z","updated_at":"2016-12-05T15:22:25Z","body":"I have the same problem using SDK for Java (7.3.0). May I ask what's the status on this one?"}}
{"actor":{"display_login":"katafractari"}}