You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EDIT: The problem was that the svc account running the TM1 DB service had to have access to the said DB using TM1 security.
Hi,
I am facing a strange issue and could use some guidance. In our environment, TM1py connects successfully through CAM SSO when run interactively (from IDE or command line), but fails when the same Python script (or batch file with this script) is executed from a TI process under the TM1 service account. It returns following:
Traceback (most recent call last):
File "D:\Python\XXX\ABC_Activities_POST.py", line 54, in
with TM1Service(**TM1_CONFIG) as tm1:
~~~~~~~~~~^^^^^^^^^^^^^^
File "C:\Program Files\Python313\Lib\site-packages\TM1py\Services\TM1Service.py", line 67, in init
self._tm1_rest = RestService(**kwargs)
~~~~~~~~~~~^^^^^^^^^^
File "C:\Program Files\Python313\Lib\site-packages\TM1py\Services\RestService.py", line 194, in init
self.connect()
~~~~~~~~~~~~^^
File "C:\Program Files\Python313\Lib\site-packages\TM1py\Services\RestService.py", line 345, in connect
self._start_session(
~~~~~~~~~~~~~~~~~~~^
user=self._kwargs.get("user", None),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<11 lines>...
application_client_id=self._kwargs.get("application_client_id", None),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
application_client_secret=self._kwargs.get("application_client_secret", None))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python313\Lib\site-packages\TM1py\Services\RestService.py", line 717, in _start_session
token = self._build_authorization_token(
user,
...<4 lines>...
self._verify,
self._cert)
File "C:\Program Files\Python313\Lib\site-packages\TM1py\Services\RestService.py", line 932, in _build_authorization_token
return RestService._build_authorization_token_cam(user, password, namespace, gateway, verify, cert)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python313\Lib\site-packages\TM1py\Services\RestService.py", line 954, in _build_authorization_token_cam
raise RuntimeError(
"Failed to authenticate through CAM. HTTP response does not contain 'cam_passport' cookie")
RuntimeError: Failed to authenticate through CAM. HTTP response does not contain 'cam_passport' cookie
The TM1 config looks like this:
TM1_CONFIG = {
"address": "admin-server",
"port": 12345,
"ssl": True,
"namespace": "AD",
"gateway": "https://customer_ca.local/ibmcognos/bi/v1/disp"
}
As I mentioned, this error only turns up when the py script is executed from TI. When I do it using command line or Visual Studio Code, it works. I saw a thread where it was mentioned that in Cognos Configuration allowing anonymous access helps but it did not in my case as I feel this is somewhat different issue.
The SSO works when gateway URL is opened in web browser.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
EDIT: The problem was that the svc account running the TM1 DB service had to have access to the said DB using TM1 security.
Hi,
I am facing a strange issue and could use some guidance. In our environment, TM1py connects successfully through CAM SSO when run interactively (from IDE or command line), but fails when the same Python script (or batch file with this script) is executed from a TI process under the TM1 service account. It returns following:
Traceback (most recent call last):
File "D:\Python\XXX\ABC_Activities_POST.py", line 54, in
with TM1Service(**TM1_CONFIG) as tm1:
~~~~~~~~~~^^^^^^^^^^^^^^
File "C:\Program Files\Python313\Lib\site-packages\TM1py\Services\TM1Service.py", line 67, in init
self._tm1_rest = RestService(**kwargs)
~~~~~~~~~~~^^^^^^^^^^
File "C:\Program Files\Python313\Lib\site-packages\TM1py\Services\RestService.py", line 194, in init
self.connect()
~~~~~~~~~~~~^^
File "C:\Program Files\Python313\Lib\site-packages\TM1py\Services\RestService.py", line 345, in connect
self._start_session(
~~~~~~~~~~~~~~~~~~~^
user=self._kwargs.get("user", None),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<11 lines>...
application_client_id=self._kwargs.get("application_client_id", None),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
application_client_secret=self._kwargs.get("application_client_secret", None))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python313\Lib\site-packages\TM1py\Services\RestService.py", line 717, in _start_session
token = self._build_authorization_token(
user,
...<4 lines>...
self._verify,
self._cert)
File "C:\Program Files\Python313\Lib\site-packages\TM1py\Services\RestService.py", line 932, in _build_authorization_token
return RestService._build_authorization_token_cam(user, password, namespace, gateway, verify, cert)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python313\Lib\site-packages\TM1py\Services\RestService.py", line 954, in _build_authorization_token_cam
raise RuntimeError(
"Failed to authenticate through CAM. HTTP response does not contain 'cam_passport' cookie")
RuntimeError: Failed to authenticate through CAM. HTTP response does not contain 'cam_passport' cookie
The TM1 config looks like this:
TM1_CONFIG = {
"address": "admin-server",
"port": 12345,
"ssl": True,
"namespace": "AD",
"gateway": "https://customer_ca.local/ibmcognos/bi/v1/disp"
}
As I mentioned, this error only turns up when the py script is executed from TI. When I do it using command line or Visual Studio Code, it works. I saw a thread where it was mentioned that in Cognos Configuration allowing anonymous access helps but it did not in my case as I feel this is somewhat different issue.
The SSO works when gateway URL is opened in web browser.
Can you please provide any help?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions