Page 1 of 1

TM1 - Connection Error

Posted: Fri May 08, 2020 6:11 am
by Andre@s
Hello Community,

I am struggling connection to TM1 with python TM1py.

Failure Message:
TM1pyException: Text: Status Code: 401 Reason: Unauthorized Headers: {'Content-Type': 'text/plain', 'Content-Length': '0', 'Connection': 'keep-alive', 'Set-Cookie': 'TM1SessionId=anysession_id; Path=/api/; HttpOnly; Secure', 'WWW-Authenticate': 'CAMPassport http://anyserveraddress:9300/bi/v1/disp, CAMNamespace'}
Code I am using:

Code: Select all

import configparser

config = configparser.ConfigParser()
config.read('config.ini')

from TM1py.Objects import Dimension, Element, ElementAttribute, Hierarchy
from TM1py import TM1Service
tm1 = TM1Service(**config['Tm1server'])
Config used for test:
[Tm1server]
address=anyserveraddress
port=8888
user=admin
password=apple
gateway=
ssl=True

What does it mean to have an Unauthorized Header?
Thanks for your help!

BR Andreas

Re: TM1 - Connection Error

Posted: Fri May 08, 2020 7:04 am
by Elessar
Hi,

What is IntegratedSecurityMode in tm1s.cfg? Admin+Apple usually stands for 1, but CAM is 4 or 5.

Re: TM1 - Connection Error

Posted: Fri May 08, 2020 7:12 am
by Andre@s
Hello Elessar,

thanks for your reply!

I checked again and problem is solved.

Issue was the missing and wrongly spelled CAMNamespace.
Topic can be closed.

Thanks!
Have a nice weekend!
Andreas