Hi, João
I wrote a code to do that:
You have to create a HTML page that has input fields for namespace, user name and password.
If you have only one namespace, you can hardcode it as I did (NameSpaceID). This information you may find in Content Manager Cognos Configuration.
Then, save this HMTL page in cognos_gw_install/webcontent and set Cognos login page to this page on Cognos Administration new UI. (Manage > Configuration > System > Security)
function doLogon()
{
try {
var objXHR = new XMLHttpRequest();
} catch (e) {
try {
var objXHR = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
try {
var objXHR = new ActiveXObject('Microsoft.XMLHTTP');
} catch (e) {
alert('XMLHttpRequest não suportado'); }
}
}
var nameSpace = 'NameSpaceId';
var userName = document.getElementById("sample.username").value;
var password = document.getElementById("sample.password").value;
var divError = document.getElementById("sampleIncorrectLoginText");
var baseUrl = window.location.protocol + "
var xmlData =
"xmlData=<auth:credentials xmlns:auth='http://developer.cognos.com/schemas/ccs/auth/types/1'>"
+"<auth:credentialElements><auth:name>CAMNamespace</auth:name>"
+"<auth:value><auth:actualValue>"+nameSpace+"</auth:actualValue></auth:value></auth:credentialElements>"
+"<auth:credentialElements><auth:name>CAMUsername</auth:name>"
+"<auth:value><auth:actualValue>"+userName+"</auth:actualValue></auth:value></auth:credentialElements>"
+"<auth:credentialElements><auth:name>CAMPassword</auth:name>"
+"<auth:value><auth:actualValue>"+password+"</auth:actualValue></auth:value></auth:credentialElements>"
+"</auth:credentials>";
document.getElementById('sample.login').disabled = true;
try
{
objXHR.onreadystatechange = function() {
if (objXHR.readyState == 4) {
if (objXHR.status == 200) {
var accountInfo = objXHR.responseXML.getElementsByTagName("auth:accountInfo");
if (accountInfo.length > 0)
{
window.location.replace(baseUrl);
}
else
{
divError.innerHTML = "Problemas ao efetuar o logon. Verifique as credenciais. \r\n" + objXHR.responseText;
document.getElementById('sample.login').disabled = false;
}
}
else
{
divError.innerHTML = "Problemas ao efetuar o logon. Verifique as credenciais. \r\n" + objXHR.responseText;
document.getElementById('sample.login').disabled = false;
}
}
}
objXHR.open("POST", baseUrl + "/bi/v1/disp/rds/auth/logon", false);
objXHR.setRequestHeader("Content-type","application/x-www-form-urlencoded");
objXHR.setRequestHeader("Content-length",xmlData.length);
objXHR.setRequestHeader("Connection","close");
objXHR.send(xmlData);
}
catch (e)
{
divError.innerHTML = "Problemas ao efetuar o logon. \r\n" + e;
document.getElementById('sample.login').disabled = false;
}
}
------------------------------
JEAM COELHO
------------------------------
Original Message:
Sent: Thu July 30, 2020 09:39 AM
From: João Galdino
Subject: Sing a REST URL to logon to the IBM Cognos Analytics
Reference URL: https://myibm.ibm.com/dashboard/
Hi I was follownig this Q&A reguarding Mashup Using a REST URL to logon to the IBM Cognos Analytics Server: https://www.ibm.com/support/pages/mashup-using-rest-url-logon-ibm-cognos-analytics-server
I understood the process but I am having some difficulties finding this information:
CAMNamespace, myNameSpaceLabel, CAMUsername, User ID:, CAMPassword, Password, myPassWord
Is there any kind of document, or instruction with more details about these items
sincerely
------------------------------
João Galdino
------------------------------
#CognosAnalyticswithWatson