We're currently exploring an application wherein we have an API that accepts a username from Salesforce and we are attempting to run an sfdx command as that user on an external server (a node app). Is something like this possible? For example, is it possible to authorize our "app" in a salesforce org and then allow any user in the org to run sfdx commands as themselves on our external server?

Thanks (sorry if vague)

1 Answer 1


Yes, it's technically possible. After setting up your Connected App, have the user log in through your app using the Web Server OAuth Flow, then have your node app call sfdx auth:accesstoken:store command to set the session, then you can use sfdx commands as you'd expect. All the information you need to complete this setup will be returned to you as part of the OAuth flow. See also Create a Connected App for Your Dev Hub Org for instructions on creating the necessary Connected App.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .