cubewise-code / tm1py-samples

Do more with TM1 with these ready to use TM1py samples.
https://github.com/cubewise-code/TM1py
MIT License
59 stars 45 forks source link

'HttpNegotiateAuth' is not defined #79

Closed EdouarL closed 3 years ago

EdouarL commented 3 years ago

Hi team,

I'm trying to test connection. Here my configuration TM1 and Cognos both on 2 different Windows environment

TM1s.cfg SecurityPackageName=Kerberos IntegratedSecurityMode=5 UseSSL=T HTTPPortNumber=8160 ClientCAMURI=http://sub.domain.com:9300/bi/v1/disp

config.ini [tm1srv01] address=localhost port=8160 user=myusername password=mypasswordbase64encoded ssl=True decode_b64=True gateway=http://sub.domain.com:9300/bi/v1/disp namespace=Cognos Namespace

Here the code with python.exe

from TM1py.Services import TM1Service import configparser config = configparser.ConfigParser() config.read(r'.\config.ini') with TM1Service(**config['tm1srv01']) as tm1: for chore in tm1.chores.get_all(): chore.reschedule(hours=-1) tm1.chores.update(chore)

Traceback (most recent call last): File "C:\Users\userBob\AppData\Local\Programs\Python\Python38\lib\site-packages\tm1py-1.5.0-py3.8.egg\TM1py\Services\RestService.py", line 392, in _build_authorization_token_cam NameError: name 'HttpNegotiateAuth' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "C:\Users\userBob\AppData\Local\Programs\Python\Python38\lib\site-packages\tm1py-1.5.0-py3.8.egg\TM1py\Services\TM1Service.py", line 13, in init File "C:\Users\userBob\AppData\Local\Programs\Python\Python38\lib\site-packages\tm1py-1.5.0-py3.8.egg\TM1py\Services\RestService.py", line 165, in init File "C:\Users\userBob\AppData\Local\Programs\Python\Python38\lib\site-packages\tm1py-1.5.0-py3.8.egg\TM1py\Services\RestService.py", line 293, in _start_session File "C:\Users\userBob\AppData\Local\Programs\Python\Python38\lib\site-packages\tm1py-1.5.0-py3.8.egg\TM1py\Services\RestService.py", line 383, in _build_authorization_token File "C:\Users\userBob\AppData\Local\Programs\Python\Python38\lib\site-packages\tm1py-1.5.0-py3.8.egg\TM1py\Services\RestService.py", line 394, in _build_authorization_token_cam RuntimeError: SSO failed due to missing dependency requests_negotiate_sspi.HttpNegotiateAuth. SSO only supported for Windows

Could you help ? many thanks, Ed

MariusWirtz commented 3 years ago

It looks like you are missing a dependency: requests_negotiate_sspi. Just run: pip install requests_negotiate_sspi

By the way, when you authenticate with CAM and SSO, you don't have to provide user and password.

EdouarL commented 3 years ago

Right, I incorrect install the requests_negotiate_sspi dependency.