You need to sign in to do that
Don't have an account?
Daniel Rudman 7
Salesforce DX - Scratch Connection Invalid Access Token
Hi, we have written a custom DX plugin and are trying to use the injected connection to the scratch org to login and insert some data. We use the access token which is returned by:
this.org.getConnection().getConnectionOptions().accessToken
To authenticate, but get the error:
The following error occurred during deployment: [UnexpectedErrorFault [ApiFault exceptionCode='INVALID_SESSION_ID' exceptionMessage='Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session hash: XXXXXXX This error usually occurs after a session expires or a user logs out. ' extendedErrorDetails='{[0]}' ] ]
But then if I do a: sfdx force:org:open - u <scratch_org_username> , then it works.
Is there a call I can make in our DX plugin to force this refresh or anything else to make it work, without having consumers manually go and perform an open?
I tried everything in the API which I could see as relevant, like refreshAuth, but it did not hellp.
Thanks in advance!
this.org.getConnection().getConnectionOptions().accessToken
To authenticate, but get the error:
The following error occurred during deployment: [UnexpectedErrorFault [ApiFault exceptionCode='INVALID_SESSION_ID' exceptionMessage='Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session hash: XXXXXXX This error usually occurs after a session expires or a user logs out. ' extendedErrorDetails='{[0]}' ] ]
But then if I do a: sfdx force:org:open - u <scratch_org_username> , then it works.
Is there a call I can make in our DX plugin to force this refresh or anything else to make it work, without having consumers manually go and perform an open?
I tried everything in the API which I could see as relevant, like refreshAuth, but it did not hellp.
Thanks in advance!