{"action":"created","issue":{"url":"https://api.github.com/repos/cubewise-code/tm1py/issues/165","repository_url":"https://api.github.com/repos/cubewise-code/tm1py","labels_url":"https://api.github.com/repos/cubewise-code/tm1py/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/cubewise-code/tm1py/issues/165/comments","events_url":"https://api.github.com/repos/cubewise-code/tm1py/issues/165/events","html_url":"https://github.com/cubewise-code/tm1py/issues/165","id":480371921,"node_id":"MDU6SXNzdWU0ODAzNzE5MjE=","number":165,"title":"TM1Py CAM Non-SSO Authentication from Linux","user":{"login":"BigFriendly","id":52714865,"node_id":"MDQ6VXNlcjUyNzE0ODY1","avatar_url":"https://avatars3.githubusercontent.com/u/52714865?v=4","gravatar_id":"","url":"https://api.github.com/users/BigFriendly","html_url":"https://github.com/BigFriendly","followers_url":"https://api.github.com/users/BigFriendly/followers","following_url":"https://api.github.com/users/BigFriendly/following{/other_user}","gists_url":"https://api.github.com/users/BigFriendly/gists{/gist_id}","starred_url":"https://api.github.com/users/BigFriendly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigFriendly/subscriptions","organizations_url":"https://api.github.com/users/BigFriendly/orgs","repos_url":"https://api.github.com/users/BigFriendly/repos","events_url":"https://api.github.com/users/BigFriendly/events{/privacy}","received_events_url":"https://api.github.com/users/BigFriendly/received_events","type":"User","site_admin":false},"labels":[{"id":274608635,"node_id":"MDU6TGFiZWwyNzQ2MDg2MzU=","url":"https://api.github.com/repos/cubewise-code/tm1py/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-08-13T21:14:13Z","updated_at":"2019-08-13T21:44:13Z","closed_at":null,"author_association":"NONE","body":"I'm trying to determine if TM1py ought to be able to authenticate via CAM username/password (not NTLM SSO) on Linux?\r\n\r\nI understand that TM1py CAM SSO requires HttpNegotiateAuth which requires pypiwin32 and pywin32 which are Windows only packages.  It appears, however, that the entire CAM authorization function in RESTService.py (shown below) is reliant upon the Windows-only HttpNegotiateAuth.  If not using SSO, could the code be written to utilize standard HTTPAdapter calls to setup the authorization?\r\n\r\n    def _build_authorization_token_cam(user=None, password=None, namespace=None, gateway=None):\r\n        if gateway:\r\n            if not HttpNegotiateAuth:\r\n                raise RuntimeError(\r\n                    \"SSO failed due to missing dependency requests_negotiate_sspi.HttpNegotiateAuth. \"\r\n                    \"SSO only supported for Windows\")\r\n            response = requests.get(gateway, auth=HttpNegotiateAuth())\r\n            if not response.status_code == 200:\r\n                raise RuntimeError(\r\n                    \"Failed to authenticate through CAM. Expected status_code 200, received status_code: \"\r\n                    + str(response.status_code))\r\n            elif 'cam_passport' not in response.cookies:\r\n                raise RuntimeError(\r\n                    \"Failed to authenticate through CAM. HTTP response does not contain 'cam_passport' cookie\")\r\n            else:\r\n                return 'CAMPassport ' + response.cookies['cam_passport']\r\n        else:\r\n            return 'CAMNamespace ' + b64encode(str.encode(\"{}:{}:{}\".format(user, password, namespace))).decode(\"ascii\")\r\n\r\n\r\nThank you.  -- John"},"comment":{"url":"https://api.github.com/repos/cubewise-code/tm1py/issues/comments/521021105","html_url":"https://github.com/cubewise-code/tm1py/issues/165#issuecomment-521021105","issue_url":"https://api.github.com/repos/cubewise-code/tm1py/issues/165","id":521021105,"node_id":"MDEyOklzc3VlQ29tbWVudDUyMTAyMTEwNQ==","user":{"login":"MariusWirtz","id":15182131,"node_id":"MDQ6VXNlcjE1MTgyMTMx","avatar_url":"https://avatars0.githubusercontent.com/u/15182131?v=4","gravatar_id":"","url":"https://api.github.com/users/MariusWirtz","html_url":"https://github.com/MariusWirtz","followers_url":"https://api.github.com/users/MariusWirtz/followers","following_url":"https://api.github.com/users/MariusWirtz/following{/other_user}","gists_url":"https://api.github.com/users/MariusWirtz/gists{/gist_id}","starred_url":"https://api.github.com/users/MariusWirtz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MariusWirtz/subscriptions","organizations_url":"https://api.github.com/users/MariusWirtz/orgs","repos_url":"https://api.github.com/users/MariusWirtz/repos","events_url":"https://api.github.com/users/MariusWirtz/events{/privacy}","received_events_url":"https://api.github.com/users/MariusWirtz/received_events","type":"User","site_admin":false},"created_at":"2019-08-13T21:44:13Z","updated_at":"2019-08-13T21:44:13Z","author_association":"COLLABORATOR","body":"Hi @BigFriendly ,\r\n\r\nyou can already use TM1py on linux with CAM when authenticating with user and password.\r\nIt's implemented here:\r\nhttps://github.com/cubewise-code/tm1py/blob/51df8e21927119c9b0f8dd20d2ba5f57e0ea8a65/TM1py/Services/RESTService.py#L315\r\n\r\nWe also adjusted the `setup.py` script (that is used by pip during the install) so that it doesn't try to install windows libraries on Linux.\r\n\r\nSo you should be good to go"}}
{"actor":{"display_login":"MariusWirtz"}}