IBM Support

Mashup - Using REST request without a direct "Connect" method to the Server.

Question & Answer


Question

Network security in the Company does not allow external CONNECT's to the Infrastructure, and that's keeping the Mashup logon command and connection from working. Is there a way to instantiate a Mashup session without doing a CONNECT?

Answer

Yes there is a method to use a User Agent connection, passing in the Credentials that can be allowed through the Security Systems and the request subsequently be routed to IBM Cognos Server.

Here is the IBM Cognos Mashup Developer Guide Logon Connection method that is used normally :


//User credentials are passed to the IBM Cognos server
AuthService authService = new AuthService();
authService.Url = url;

LogonRequestType authRequest = new LogonRequestType();
authRequest.credentials = new CredentialType();
authRequest.credentials.credentialElements = new CredentialElementType[3];
authRequest.credentials.credentialElements[0] = newCredentialElementType();
authRequest.credentials.credentialElements[0].name = "CAMNamespace";
authRequest.credentials.credentialElements[0].value = new ValueElementType();
authRequest.credentials.credentialElements[0].value.Item = nameSpaceID;
authRequest.credentials.credentialElements[1] = new CredentialElementType();
authRequest.credentials.credentialElements[1].name = "CAMUsername";
authRequest.credentials.credentialElements[1].value = new ValueElementType();
authRequest.credentials.credentialElements[1].value.Item = userName;
authRequest.credentials.credentialElements[2] = new CredentialElementType();
authRequest.credentials.credentialElements[2].name = "CAMPassword";
authRequest.credentials.credentialElements[2].value = new ValueElementType();
authRequest.credentials.credentialElements[2].value.Item = passWord;
LogonResponseType authResp = authService.logon(authRequest);

This of course will work fine for most installations.

However , it is sending a CONNECT request to to the infrastructure as opposed to a POST or PUT HTTP request.

When a CONNECT is not allowed through the Webserver , an other Method needs to be done.

The assignment of a User-Agent to the Request can assist with this , as security can be set up to allow this Agent to pass through , without doing the above Connect to the infrastructure itself.
The request then needs to be passed on , to the Cognos Server in the Infrastructure :

User-Agent:

AuthService authService = new AuthService();
authService.Url = url;
authService.UserAgent = "MyMashupAgent";

LogonRequestType authRequest = new LogonRequestType();
...
// build credentials as before and as given here above
...
LogonResponseType authResp = authService.logon(authRequest);

Tested With C 10.2.2.x and IBM JDK 7.0

[{"Product":{"code":"SSEP7J","label":"Cognos Business Intelligence"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Mashup Services","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"10.2.2;10.2.1;10.2;10.1.1;10.1","Edition":"Edition Independent","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSTSF6","label":"IBM Cognos Analytics"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":" ","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"11.0","Edition":"Edition Independent","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
24 February 2020

UID

swg21971839