The nforce8 authenticate method doesn't support the client_credentials grant_type. Salesforce is requiring a migration from Connected Apps to External Client Apps. External Client Apps don't support username-password flow.
From: Comparison of Connected Apps and External Client Apps Features
- External client apps use OAuth protocols to authorize third-party apps. However, there are some OAuth features that are available for connected apps but aren’t available for external client apps. For example, the OAuth username-password flow won't be made available for external client apps.
Adding the support isn't hard, just need to add an else to set client_credentials as the grant_type:
//TODO: Add JWT authentication
if (opts.code) {
bopts.grant_type = 'authorization_code';
bopts.code = opts.code;
bopts.redirect_uri = self.redirectUri;
} else if (opts.assertion) {
bopts.grant_type = 'assertion';
bopts.assertion_type = 'urn:oasis:names:tc:SAML:2.0:profiles:SSO:browser';
bopts.assertion = opts.assertion;
} else if (opts.username || this.username) {
bopts.grant_type = 'password';
bopts.username = opts.username || this.getUsername();
bopts.password = opts.password || this.getPassword();
if (opts.securityToken || this.getSecurityToken()) {
bopts.password += opts.securityToken || this.getSecurityToken();
}
if (this.mode === 'single') {
this.setUsername(bopts.username);
this.setPassword(bopts.password);
this.setSecurityToken(bopts.securityToken);
}
} else {
bopts.grant_type = 'client_credentials';
}
The nforce8 authenticate method doesn't support the client_credentials grant_type. Salesforce is requiring a migration from Connected Apps to External Client Apps. External Client Apps don't support username-password flow.
From: Comparison of Connected Apps and External Client Apps Features
Adding the support isn't hard, just need to add an else to set client_credentials as the grant_type: