I am in the process of creating a Slack-Salesforce chat bot, and I am currently using node.js and nforce to achieve this.
I have the following code snippet for connecting to Salesforce:
let org = nforce.createConnection ({
clientId: SLACK_CLIENT_ID,
clientSecret: SLACK_CLIENT_SECRET,
redirectUri: 'http://localhost:3000/oauth/_callback',
mode: 'single',
autoRefresh: true
});
let login = () => {
org.authenticate({username: SF_USER_NAME, password: SF_PASSWORD}, err => {
if (err) {
console.error("Authentication error");
console.error(err);
} else {
console.log("Authentication successful");
}
});
}
However, I received an error invalid_client_id - client identifier invalid
when I called the login method. The client Id is the Id provided by Slack when I installed by chat bot, so I am not sure why it is not working. It would be great if someone can help me out with this. Thanks.