{"action":"created","issue":{"url":"https://api.github.com/repos/twilio/twilio-java/issues/304","repository_url":"https://api.github.com/repos/twilio/twilio-java","labels_url":"https://api.github.com/repos/twilio/twilio-java/issues/304/labels{/name}","comments_url":"https://api.github.com/repos/twilio/twilio-java/issues/304/comments","events_url":"https://api.github.com/repos/twilio/twilio-java/issues/304/events","html_url":"https://github.com/twilio/twilio-java/issues/304","id":190938196,"number":304,"title":"How to Generate Capability Token For Client in Java Like Below code in Twilio 7.x","user":{"login":"aahtesham","id":17232352,"avatar_url":"https://avatars.githubusercontent.com/u/17232352?v=3","gravatar_id":"","url":"https://api.github.com/users/aahtesham","html_url":"https://github.com/aahtesham","followers_url":"https://api.github.com/users/aahtesham/followers","following_url":"https://api.github.com/users/aahtesham/following{/other_user}","gists_url":"https://api.github.com/users/aahtesham/gists{/gist_id}","starred_url":"https://api.github.com/users/aahtesham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aahtesham/subscriptions","organizations_url":"https://api.github.com/users/aahtesham/orgs","repos_url":"https://api.github.com/users/aahtesham/repos","events_url":"https://api.github.com/users/aahtesham/events{/privacy}","received_events_url":"https://api.github.com/users/aahtesham/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-22T08:44:12Z","updated_at":"2016-11-22T18:37:12Z","closed_at":null,"body":"    TwilioCapability capability = new TwilioCapability(account, auth_token);\r\n\t\t\t\tcapability.allowClientOutgoing(applicationSid);\r\n\t\t\t\tcapability.allowClientIncoming(\"Safr\");\r\n\t\t\t\ttry {\r\n\t\t\t\t\tSystem.out.println(capability.generateToken());\r\n\t\t\t\t} catch (DomainException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\r\nThis Code is not Supported in Twilio 7.x Please Tell me About this "},"comment":{"url":"https://api.github.com/repos/twilio/twilio-java/issues/comments/262326193","html_url":"https://github.com/twilio/twilio-java/issues/304#issuecomment-262326193","issue_url":"https://api.github.com/repos/twilio/twilio-java/issues/304","id":262326193,"user":{"login":"jingming","id":1530951,"avatar_url":"https://avatars.githubusercontent.com/u/1530951?v=3","gravatar_id":"","url":"https://api.github.com/users/jingming","html_url":"https://github.com/jingming","followers_url":"https://api.github.com/users/jingming/followers","following_url":"https://api.github.com/users/jingming/following{/other_user}","gists_url":"https://api.github.com/users/jingming/gists{/gist_id}","starred_url":"https://api.github.com/users/jingming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jingming/subscriptions","organizations_url":"https://api.github.com/users/jingming/orgs","repos_url":"https://api.github.com/users/jingming/repos","events_url":"https://api.github.com/users/jingming/events{/privacy}","received_events_url":"https://api.github.com/users/jingming/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T18:37:12Z","updated_at":"2016-11-22T18:37:12Z","body":"hey @aahtesham!\r\n\r\nThe new version of the helper library migrated this to a builder pattern. To do the above you can use: \r\n```java\r\nList<Scope> scopes = Lists.newArrayList(\r\n    new OutgoingClientScope.Builder(APPLICATION_SID).build(),\r\n    new IncomingClientScope(\"Safr\")\r\n);\r\n\r\nJwt jwt = new ClientCapability.Builder(ACCOUNT_SID, AUTH_TOKEN)\r\n    .scopes(scopes)\r\n    .build();\r\n\r\nSystem.out.println(jwt.toJwt());\r\n```"}}
{"actor":{"display_login":"jingming"}}