REST API CAM Authentication - PA (Cloud)

Post Reply
EvgenyT
Community Contributor
Posts: 324
Joined: Mon Jul 02, 2012 9:39 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: 2016
Location: Sydney, Australia

REST API CAM Authentication - PA (Cloud)

Post by EvgenyT »

Hi,

In case you came across an issue getting REST API CAM Authentication working in PA Cloud (404 unauthorized error), here are some tips (using Postman):

1. Set Authorization: No Auth. Postman will automatically set Authorization header to Basic otherwise
2. In Headers, add a new "Authorization" key
3. Use Base64 (https://www.base64encode.org/), put your non-interactive PA cloud account details in as followed: user:pw:namespace. Hit encode
4. Use encoded string as value for the "Authorization" key, e.g CAMNamespace YmtsLXByb2QwMV90bTFfYXV0b21hdGlvbjpkYU81NGJzUjJxdXp4NzpMREFQ


From what I have read, REST API CAM Authentication calls must be encoded in Base64

Hope that helps!

Regards,

Evgeny
Attachments
postman.PNG
postman.PNG (40.09 KiB) Viewed 6157 times
My24
Posts: 18
Joined: Tue Dec 12, 2017 2:57 pm
OLAP Product: TM1
Version: PA 2.0
Excel Version: Excel 2016

Re: REST API CAM Authentication - PA (Cloud)

Post by My24 »

Hello,
As I know Base64 is an encoding tool, not encrpytion tool.
Is there any way to encrypt password in REST API CAM authentication rather than Base64 encoding?
EvgenyT
Community Contributor
Posts: 324
Joined: Mon Jul 02, 2012 9:39 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: 2016
Location: Sydney, Australia

Re: REST API CAM Authentication - PA (Cloud)

Post by EvgenyT »

Yes, encoding and encrypting are too different things.
No, I'm not sure re encryption of CAM password, but something to investigate when I have free time :)
Edward Stuart
Community Contributor
Posts: 248
Joined: Tue Nov 01, 2011 10:31 am
OLAP Product: TM1
Version: All
Excel Version: All
Location: Manchester
Contact:

Re: REST API CAM Authentication - PA (Cloud)

Post by Edward Stuart »

Another good resource is Mastering the TM1 REST API with Postman by Cubewise

If you are utilising Postman then I'd recomend The TM1 Rest API collection for Postman as a solid starting point
Wim Gielis
MVP
Posts: 3113
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: REST API CAM Authentication - PA (Cloud)

Post by Wim Gielis »

Thanks.

Does this method differ from CAM authentication when the installation is on premise ?
Put differently, can this only be used for a cloud setup or for all CAM authentication cases ?
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
ascheevel
Community Contributor
Posts: 287
Joined: Fri Feb 15, 2013 5:49 pm
OLAP Product: TM1
Version: PA 2.0.9.1
Excel Version: 365
Location: Minneapolis, USA

Re: REST API CAM Authentication - PA (Cloud)

Post by ascheevel »

Wim Gielis wrote: Thu Dec 12, 2019 10:49 am Thanks.

Does this method differ from CAM authentication when the installation is on premise ?
Put differently, can this only be used for a cloud setup or for all CAM authentication cases ?
You can use this method for on-premise as well. For on-premise, you aren't restricted to only using the LDAP namespace and non-interactive account: you can use any user's username/password.
Wim Gielis
MVP
Posts: 3113
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: REST API CAM Authentication - PA (Cloud)

Post by Wim Gielis »

ascheevel wrote: Thu Dec 12, 2019 2:30 pm You can use this method for on-premise as well. For on-premise, you aren't restricted to only using the LDAP namespace and non-interactive account: you can use any user's username/password.
Thank you, I will experiment and try to get it working.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
MVP
Posts: 3113
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: REST API CAM Authentication - PA (Cloud)

Post by Wim Gielis »

Got it working, thank you.
At least, this saves some work (for what I use the REST API) to open a TM1 model with IntegratedSecurityMode = 1,
execute REST API calls, return back to integratedsecuritymode = 5 e.g.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
User avatar
Mike Cowie
Site Admin
Posts: 482
Joined: Sun May 11, 2008 7:07 pm
OLAP Product: IBM TM1/PA, SSAS, and more
Version: Anything thru 11.x
Excel Version: 2003 - Office 365
Location: Alabama, USA
Contact:

Re: REST API CAM Authentication - PA (Cloud)

Post by Mike Cowie »

My24 wrote: Thu Dec 12, 2019 6:10 am Is there any way to encrypt password in REST API CAM authentication rather than Base64 encoding?
To encrypt those credentials just make sure you're sending requests to the REST API over HTTPS and NOT HTTP. That is the basic difference between encrypting or not.

Setting UseSSL=T in TM1S.CFG will force you to use HTTPS: that ensures you can't send unencrypted REST API requests (including login credentials) and it also won't allow the TM1 Server to send REST API response data to you in an unencrypted form.

Using HTTP is fine if you're doing some quick REST API testing and don't want to deal with the SSL certificates required by HTTPS (which can be a little painful depending on the tool being used), but if you're doing more than quick local testing you should make sure your REST API calls are using HTTPS.
Mike Cowie
QueBIT Consulting, LLC

Are you lost without Print Reports in Planning Analytics for Excel (PAfE)? Get it back today, for free, with Print Reports for IBM Planning Analytics for Excel!
Post Reply