IBM Support

TM1 API - Using the C / C++ API to logon to a TM1 Server secured with a IBM Cognos Namespace

Question & Answer


Question

How can TM1 use the C/C++ API to provide a logon to a TM1 Server secured with a IBM Cognos Namespace Mode 4 and 5 ?

Answer

The code below is for C/C++ and applies to the stated TM1 versions and IBM Cognos Software.

Management of the Users should be done in the used Authentication Source for the Cognos Server, or in the Cognos Authentication Namespace itself. This is a best practice change from the normal management of Users / Groups security done in TM1.

Individual Users can be added using the Cognos security objects in TM1, but it woluld be a better practice to use the Groups and Roles from Cognos Namespace into TM1 security.

In that manner a set of users belonging to a Group or Role can be mapped to the various areas of the TM1 cube, without having the granularity down to the user level.

Management for the users is than done in the Cognos Authentication Namespaces or in the External Authentication Source.

The following code is only to be used when the IntegratedSecurityMode parameter in TM1s.cfg is set to Four (4) or Five (5) using Cognos Authentication Method (CAM) for TM1.

Connection with a CAMNamespace in Cognos using TM1SystemServerConnectWithCAMNamespace :



TM1V voServerName = TM1ValStringW( hPool, (TM1_UTF16_T *)pszServerName, 0 );

TM1V voPasswd = TM1ValStringEncryptW( hPool, (TM1_UTF16_T*)pszPassword, 0 );

TM1V vArray[3];
vArray[0] = TM1ValStringW( hPool, (TM1_UTF16_T*)szCAMNamespace, 0 );       
vArray[1] = TM1ValStringW( hPool, (TM1_UTF16_T*)admin_login_name, 0 );
vArray[2] = voPasswd;
 
TM1V vCAMArgArr = TM1ValArray(hPool, vArray, 3);
TM1V vTmpServer = TM1SystemServerConnectWithCAMNamespace(hPool, voServerName, vCAMArgArr);

The CAM namespace is the internal name of namespace in Cognos, not the display name. This should be looked up in Cognos Configuration mananger, and is the entry of NamespaceID in the Authentication Connection.

Connection with using a CAMPassport example using TM1SystemServerConnectWithCAMPassport :

TM1V vArray[1];
vArray[0] = TM1ValStringW(hPool, (TM1_UTF16_T*)pszPassport, 0);     
TM1V vCAMArgArr = TM1ValArray(hPool, vArray, 1);
TM1V vTmpServer = TM1SystemServerConnectWithCAMPassport(hPool, voServerName, vCAMArgArr);

Note that the CAMPassport needs to be retrieved from the users Webserver Session Environment. This can be done via the Cognos SDK API for example, and does not come directly from the Cognos Installation. For samples in Java see the other attached Technote References.

[{"Product":{"code":"SS9RXT","label":"Cognos TM1"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Component":"TM1","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.5.2;9.5.1;9.5;9.4 MR1;9.4;10.1.0","Edition":"Edition Independent","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSEP7J","label":"Cognos Business Intelligence"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Component":"Software Development Kit","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"","label":"HP Itanium"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.4.1;8.4","Edition":"Edition Independent","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
28 November 2022

UID

swg21418355