{ "id": "97448", "key": "TIMOB-9986", "fields": { "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true }, "parent": { "id": "89765", "key": "TIMOB-8652", "fields": { "summary": "Core: Create a new Titanium Command Line Interface", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "6", "description": "gh.issue.epic.desc", "name": "Epic", "subtask": false } } }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14160", "description": "Sprint 2012-19 JS", "name": "Sprint 2012-19 JS", "archived": true, "released": true, "releaseDate": "2012-09-24" }, { "id": "14271", "description": "2012 Sprint 19", "name": "2012 Sprint 19", "archived": true, "released": true, "releaseDate": "2012-09-24" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-09-13T15:38:04.000+0000", "created": "2012-07-17T01:54:45.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "20584", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "outwardIssue": { "id": "94690", "key": "TISTUD-1897", "fields": { "summary": "Add support for log-in and log-out for the V2 CLI", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2017-03-08T00:41:11.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "13103", "name": "CLI", "description": "Node-based command line interface" } ], "description": "Logs a user into and out of the Appcelerator Network.\r\n\r\nSession cookie and user info (not sure what info... whatever app-track requires) to be written to ~/.titanium/session.json (or something).\r\n\r\nNeed to tie into --user and --password options (currently wired up, but disabled).\r\n\r\nNot sure how to check if a session is valid. Not sure if we should persist credentials.\r\n\r\nHere's an example curl command:\r\n\r\n{code}\r\ncurl https://api.appcelerator.net/p/v1/sso-login -v -d \"un=user@domain.com\" -d \"pw=123123\" -d \"mid=1eagg1a3eg1gea1gae1gea1g2e1\"\r\n{code}\r\n\r\nWhich produces:\r\n\r\n{code}\r\n* About to connect() to api.appcelerator.net port 443 (#0)\r\n* Trying 107.21.236.169...\r\n* connected\r\n* Connected to api.appcelerator.net (107.21.236.169) port 443 (#0)\r\n* SSLv3, TLS handshake, Client hello (1):\r\n* SSLv3, TLS handshake, Server hello (2):\r\n* SSLv3, TLS handshake, CERT (11):\r\n* SSLv3, TLS handshake, Server finished (14):\r\n* SSLv3, TLS handshake, Client key exchange (16):\r\n* SSLv3, TLS change cipher, Client hello (1):\r\n* SSLv3, TLS handshake, Finished (20):\r\n* SSLv3, TLS change cipher, Client hello (1):\r\n* SSLv3, TLS handshake, Finished (20):\r\n* SSL connection using AES256-SHA\r\n* Server certificate:\r\n* \t subject: O=*.appcelerator.net; OU=Domain Control Validated; CN=*.appcelerator.net\r\n* \t start date: 2011-10-13 21:14:23 GMT\r\n* \t expire date: 2013-10-13 21:14:23 GMT\r\n* \t subjectAltName: api.appcelerator.net matched\r\n* \t issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=http://certificates.godaddy.com/repository; CN=Go Daddy Secure Certification Authority; serialNumber=07969287\r\n* \t SSL certificate verify ok.\r\n> POST /p/v1/sso-login HTTP/1.1\r\n> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5\r\n> Host: api.appcelerator.net\r\n> Accept: */*\r\n> Content-Length: 69\r\n> Content-Type: application/x-www-form-urlencoded\r\n> \r\n* upload completely sent off: 69 out of 69 bytes\r\n< HTTP/1.1 200 OK\r\n< Access-Control-Allow-Methods: POST, GET, OPTIONS\r\n< Cache-Control: private\r\n< Content-Type: application/json;charset=utf-8\r\n< Date: Tue, 11 Sep 2012 18:52:50 GMT\r\n< Expires: Thu, 19 Nov 1981 08:52:00 GMT\r\n< Pragma: no-cache\r\n< Server: Apache/2.2.14 (Ubuntu)\r\n< Set-Cookie: PHPSESSID=ob6jvsgjmpqa8uod909te6ksd6; path=/; domain=.appcelerator.net\r\n< Vary: Accept-Encoding\r\n< X-Powered-By: PHP/5.3.2-1ubuntu4.14\r\n< Content-Length: 1603\r\n< Connection: keep-alive\r\n< \r\n* Connection #0 to host api.appcelerator.net left intact\r\n{\"success\":true,\"sid\":\"2e2ecb2f2c5ceaa5f8fda590fb17751443e4db96\",\"token\":\"00000000\",\"uid\":\"000000\",\"guid\":\"000000d05b4ca309776ba80694b43557\",\"uidt\":\"000000ea11b7f1b4660df54d4d46d2695d9ec724\",\"activated\":true,\"uguid\":\"000000000000000000000000\",\"email\":\"user@domain.com\",\"permissions\":{\"mobilesdk\":\"enabled\",\"is-admin\":\"enabled\",\"premium-support\":\"enabled\",\"is-staff\":\"enabled\"},\"attributes\":{\"account-confirm-date\":\"2010-06-27 12:38:36\",\"interested_in\":null,\"specialties\":\"40,5\",\"platform_experience\":\"18,17\",\"programming_langs\":\"33,28,27,30\",\"profile_completeness\":\"100\",\"department\":\"4\",\"supervisor\":\"1322484\",\"date-of-employment\":\"6\\/28\\/2010\",\"time-zone\":\"5\",\"irc-nickname\":\"cb1kenobi\",\"projects\":\"14,15,16,4\",\"skype\":\"cb1kenobi\",\"double_trigger_survey\":\"1\",\"firstname\":\"Chris\",\"lastname\":\"Barber\",\"organization\":\"Appcelerator\",\"phone\":\"000-000-0000\",\"title\":\"Engineer\",\"city\":\"Testville\",\"postalcode\":\"00000\",\"country\":\"US\",\"bio\":\"I build cool stuff for Appcelerator.\",\"titanium_appcount\":\"\",\"twitter\":\"\",\"facebook\":\"\",\"linkedin\":\"\",\"portfolio_url\":\"http:\\/\\/www.appcelerator.com\\/\",\"developer_role\":\"12\",\"develops_for\":\"48\",\"tech_level\":\"26\",\"titanium_proficiency\":\"26\",\"state\":\"CA\"},\"plans\":[{\"org_id\":00000,\"role_id\":\"1\",\"current-plan_id\":4000,\"current-product_id\":\"4006\"},{\"org_id\":14301,\"role_id\":\"11\",\"current-plan_id\":4000,\"current-product_id\":\"4006\"}],\"community\":\"false\",\"plans_data\":\"http:\\/\\/api.appcelerator.net\\/p\\/v1\\/plans-data?token=0000000000\",\"session_allowed_duration\":72}* Closing connection #0\r\n* SSLv3, TLS alert, Client hello (1):\r\n{code}\r\n\r\nHere's an example in Titanium code that would need to be ported to node.js:\r\n\r\n{code}\r\nfunction networkLogin(username, password, success, error) {\r\n\tvar xhr = Ti.Network.createHTTPClient();\r\n\r\n\t//Parity issue: iOS fires onload for 4xx and 3xx status codes, so need to manually check onload\r\n\txhr.onload = function() {\r\n\t\tif (xhr.status == 200) {\r\n\t\t\t//return the session ID to store in ACS\r\n\t\t\tvar cookies = xhr.getResponseHeader('Set-Cookie'),\r\n\t\t\t\tsessionId = '';\r\n\t\t\t_.each(cookies.split(';'), function(cookie) {\r\n\t\t\t\tvar parts = cookie.split('=');\r\n\t\t\t\tif (parts[0].indexOf('PHPSESSID') >= 0) {\r\n\t\t\t\t\tsessionId = parts[1];\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tsuccess(sessionId);\r\n\t\t}\r\n\t\telse {\r\n\t\t\terror();\r\n\t\t}\r\n\t\tTi.API.info('Status Code: '+ xhr.status);\r\n\t\tTi.API.info('Set-Cookie: '+ xhr.getResponseHeader('Set-Cookie'));\r\n\t};\r\n\t\r\n\txhr.onerror = error;\r\n\t\r\n\txhr.open('POST', 'https://api.appcelerator.net/p/v1/sso-login');\r\n\txhr.send({\r\n\t\tun:username,\r\n\t\tpw:password,\r\n\t\tmid:Ti.Platform.id\r\n\t});\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "CLI: \"login, logout\" builtin", "creator": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "environment": null, "closedSprints": [ { "id": 3, "state": "closed", "name": "Release 3.0.0", "startDate": "2012-09-27T05:26:46.636Z", "endDate": "2012-10-08T20:05:00.000Z", "completeDate": "2012-12-20T17:03:19.403Z" } ], "comment": { "comments": [ { "id": "218858", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pull Requests: \r\nhttps://github.com/appcelerator/node-appc/pull/1\r\nhttps://github.com/appcelerator/titanium/pull/4", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-13T12:49:25.000+0000", "updated": "2012-09-13T12:49:25.000+0000" }, { "id": "409760", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as resolved.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-08T00:41:11.000+0000", "updated": "2017-03-08T00:41:11.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }