Hi
I find the IBM documentation on this rather confusing where it talks about returning the details of the CAM server. That isn't necessary. In reality if someone is logging on then they are going to know whether they want to use TM1 or CAM authentication, or the application developer will have set this for them. You only need to talk to the TM1 Rest API end point, not the CAM URI. The TM1 Server knows how to go to CAM via the information in its TM1S.CFG. It will do that for you.
Below is a fragment of VueJS code that handles the formatting needed for TM1 or CAM Authentication. As per the comments, my VueJS code calls a NodeJS server which then adds on additional headers and makes the final call to the Rest API. However, the core bit is covered below in terms of making up the login details that need to be attached to the Authorization header.
async Submit() {
try{
// AuthType is TM1 or CAM
const AuthType :string = this.AuthType
const User :string = this.UserName
const Pwd :string = this.Pwd
// this.CAM will give the name of the CAM Name Space if using CAM
const CAM :string = this.CAM
let LoginType :string = 'Basic'
let UserDetails :string = User + ':' + Pwd
if(AuthType == 'CAM')
{
LoginType = 'CAMNamespace'
UserDetails += ':' + CAM
}
// This bit does the Base64 Encoding in JS
const LoginDetails :string = LoginType + ' ' +
Buffer.from(UserDetails,'binary').toString('base64')
const body = {
LoginDetails: LoginDetails
}
// HTTP is an object set up with the end point for a NodeJS
// server which adds additional headers to make the final call
// to the TM1 Rest API
const response = await HTTP.post('./Connect',body)
Now, if IBM could add some further information on handling certificates for SSL that would be good...
Regards
Paul Simon
------------------------------
Paul Simon
------------------------------
Original Message:
Sent: Wed July 07, 2021 10:30 AM
From: STUART KING
Subject: End points Planning Analytics 2.0.9 TM1 REST API
Please see: https://www.ibm.com/docs/en/planning-analytics/2.0.0?topic=api-authenticating-managing-sessions#concept_ed4_h2h_ghb
This explains how authentication with the REST API works.
------------------------------
Stuart King
IBM Planning Analytics Offering Manager
Original Message:
Sent: Tue July 06, 2021 07:19 AM
From: Manitt Khanna
Subject: End points Planning Analytics 2.0.9 TM1 REST API
We are trying to establish REST API connectivity from an Angular application to the TM1 servers that are using CAM security.
As we understand, the client application needs to make different calls to both TM1 and CAM to 1. Perform authentication and 2. To fetch data.
Our integration architect wants to understand the details around the REST APIs that are being exposed by both TM1 server and the ClientCAMURI ( FYI.. We use IIS as webserver for Cognos analytics gateway).
They would like to understand,
REST API end points, services and the parameters to be passed for TM1 server.
REST API end points, services and the payload info to be passed to CAM URI to get CAM Passport.
Also, any possibility of having one of the below to authenticate into the TM1 / CAM thru REST API.
TLS + Basic Auth, or
TLS + OAuth2 Client Credentials grant
Appreciate your help!
------------------------------
Manitt Khanna
------------------------------
#PlanningAnalyticswithWatson