Are you including "CAMNamespace" in your authorization header as a prefix to your username:password:namespace?
per IBM, your authorization header should look as follows:
CAMNamespace base64(<username>:<password>:<namespace>)
or if you've already converted your <username>:<password>:<namespace> to base64, just drop the base64() from the header:
CAMNamespace <base64 encoded username:password:namespace>
You can use a passport in your authorization header as well, but you'd need to get the passport first by authenticating against the ClientCamURI gateway. When sending the passport, the authorization headers should look like this: CAMPassport <cam_passport>
Just throwing out there that TM1py already supports what you're trying to do, but realize there may be reasons why you're not planning to use a TM1py solution.
link for anyone stumbling here and wanting to see IBM documentation on authenticating sessions:
https://www.ibm.com/docs/en/planning-an ... g-sessions