Before anyone points that this question is repetitive, I would like to mention that I have tried possible solutions given in other similar questions like Change Application Permissions to Allow access to your unique identifier
or change IP Relaxation to Relax IP restrictions
or to use org specific URL instead of http://test.salesforce.com
or http://login.salesforce.com
.
I'm trying to implement OAuth in my angular application using jsforce and the first thing I do is create OAuth
let oauth2 = new jsforce.OAuth2({
loginUrl : this.originUrl,
clientId : '<client_id>',
clientSecret : '<client_secret>',
redirectUri : "<same_as_connected_app>"
});
Then establishing connectionusing the OAuth object formed in the prior step and call Authorize on connection like mentioned in the jsforce document.
let connection = new jsforce.Connection({ oauth2 });
// Note code I'm getting from redirect url
connection.authorize(code, function(err, userInfo) {
console.log('RS err', err);
console.log('RS userInfo', userInfo);
});
Tried in postman as well getting an error. Attaching screenshot. Code fails at connection.authorize step