cubewise-code / tm1py

TM1py is a Python package that wraps the TM1 REST API in a simple to use library.
http://tm1py.readthedocs.io/en/latest/
MIT License
187 stars 107 forks source link

Bug in _determine_auth_mode #1074

Closed OliverTrupp closed 5 months ago

OliverTrupp commented 6 months ago

Bug found in "_determine_auth_mode" (TM1py.version 2.0.2). Currently the return of "_determine_auth_mode" for v11 is always "BASIC" if namespace and gateway None (See here). However, "WIA" does not require namespace and gateway either. This currently forces the user to pass namespace with a meaningless string for SSO.

address=""
port=123456
integrated_login=True
ssl=True
with TM1Service(address=address, port=port, integrated_login=integrated_login, ssl=ssl) as tm1:
    print(tm1.server.get_server_name())

Using the code with TM1py version 2.0.2, on a V11 TM1-Server will throw the error "TM1pyRestException: Text: '' - Status Code: 401 - Reason: 'Unauthorized'. With prior version there was no error, and the connection was established.

MariusWirtz commented 5 months ago

Thanks for raising the issue. please confirm that https://github.com/cubewise-code/tm1py/pull/1089 solves the issue.

pip uninstall tm1py
https://github.com/cubewise-code/tm1py/archive/refs/heads/1074-fix-auth-mode-for-wia.zip
OliverTrupp commented 5 months ago

Thanks for the solution Marius. I can confirm that #1089 solves the issue.