function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Neerav SinghNeerav Singh 

Cognos SalesFroce connectivity through secured network

I am trying to connect Cognos with SalesForce and started creating the Salesforce datasource.

I am getting error while testing the connection , error being below:
XQE-GEN-0002 An unexpected exception occurred: Connecting "<username>@<domain>.com@//https://www.salesforce.com/services/Soap/u/20.0" failed. Error message "org.apache.axis2.AxisFault: peer not authenticated".

I found out that our cognos server is in a secured network and not all ports are opened.

I checked on whats available on internet and found below:
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_concepts_security.htm
which says:
80: This port only accepts HTTP connections.
443: This port only accepts HTTPS connections.
1024–66535 (inclusive): These ports accept HTTP or HTTPS connections.

I need to know 
1. which ports should I get opened for connecting to Salesforce from Cognos is it 443?
3. List of SalesForce servers (referred https://help.salesforce.com/apex/HTViewSolution?id=000003652)
pconpcon
Recently Salesforce disabled the ability to login via www.salesforce.com.  I believe you will just wnat to change your URL to use login.salesforce.com instead
 
<username>@<domain>.com@//https://login.salesforce.com/services/Soap/u/20.0
Neerav SinghNeerav Singh
I checked with Cognos support earlier on this.  
They tried recreating the scenario and are able to connect to salesforce using following URL
https://www.salesforce.com/services/Soap/u/20.0

and said it is related to network.

Also today I tried changing the URL to https://login.salesforce.com/services/Soap/u/20.0, but got below error

Error message "<sf:LoginFault xsi:type="sf:LoginFault" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode><sf:exceptionMessage>Invalid username, password, security token; or user locked out.</sf:exceptionMessage></sf:LoginFault>"

The credentials that I used are correct and I am able to connect to salesforce using the id password.
pconpcon
Are you using a token with your password?  If you do not have the IP address of the host making this request in your host whitelist then you will need to concatenate your password and token together to do your login
 
String password = 'abc123';
String token = 'aabbccddeeffgghhiijjkk';

String passwordForAuth = password + token;

It suprises me that Cognos was able to get this to work with www.salesforce.com.  Salesforce may have delayed the removal of that endpoint but it will be going away and you should not use it but instead use login.salesforce.com so that when Salesforce does remove it your integration will continue to work.
Neerav SinghNeerav Singh
Thanks for your reply, I have used password + token to set up the connectivity.
 
Neerav SinghNeerav Singh
I have tried with login.salesforce.com & password + token (reset the token to be sure as well) combination but still does not work.

Is there something more that can be done?
Neerav SinghNeerav Singh
It worked after we added SalesForce URL to whitelist. Thanks for your inputs.