Integration with sfdx?
See original GitHub issueAfter authenticating with an org via sfdx’s (which uses oauth under the hood), it stores the accessToken and other details in a json file in the ~/.sfdx
folder.
Example:
{ orgId: '00Dd0000000cddqEAA',
accessToken: 'aaa7d0647d....3f427',
refreshToken: '9ca044f...99444886',
instanceUrl: 'https://org.my.salesforce.com',
loginUrl: 'https://login.salesforce.com',
username: 'j...@salesforce.m',
isDevHub: true }
If I use the accessToken
and instanceUrl
from that file:
const conn = new jsforce.Connection({instanceUrl, accessToken});
I get this error:
sf:INVALID_SESSION_ID: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
Any ideas?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
Continuous Integration | Salesforce DX Developer Guide
Continuous integration (CI) is a software development practice in which developers regularly integrate their code changes into a source code repository.
Read more >SFDX Continuous Integration | Tigerface Systems
In this post we will setup a CI (continuous integration) workflow that automatically runs our Apex and LWC unit tests on each code...
Read more >Salesforce DX Continuous Integration | by Ariel Dornelles
Hi everyone, I'm writing this post intending to help Salesforce developers who are starting their studies about Salesforce DX and want to ...
Read more >CI and Delivery Using Salesforce Developer Experience
Salesforce Developer Experience (SFDX) helps build a better continuous integration (CI) and delivery system with a simplified version ...
Read more >Salesforce deployment using SFDX CLI, Jenkins and GitHub
To start with basic I created Dev Org using Visual Studio Code and committed same to GitHub. Integrated SFDX CLI with Jenkins and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Rather than parse the
~/.sfdx
folder, run theforce:org:display
command with json output to obtain the access token.My guess is that the force:org:display command is not refreshing the token before showing it, perhaps displaying the last obtained value which may or may not still be valid. Or, maybe the scratch org has expired and the token is literally no longer valid.
You might try running the force:limits:api:display command first which likely will require the access token to be refreshed because the CLI has to make a REST API call and would auto-renew the token if necessary.
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_limits.htm#cli_reference_api_display