2

I'm looking into a way of handle automatic access token refresh for a scratch org and sfdx auth:sfdxurl:store looks like a good candidate. This command requires a sfdxAuthUrl.

When I sfdx auth:web:login into my scratch org I obtain the sfdxAuthUrl with sfdx force:org:display -u [email protected] --verbose --json.

Yet, when I do the same command from a newly created scratch org (just after cci flow run) the json's output has no sfdxAuthUrl. There is a way to obtain it from cci without having to first authenticate with the browser?

Or there is a better way to solve my original problem (access token refresh without browser and human intervention)?

3
  • Can you say more about your use case? Are you trying to persist access to a scratch org in some context other than where it is created?
    – David Reed
    Commented Jul 30, 2021 at 14:17
  • @DavidReed yes, we need to access the scratch org from various services deployed in kubernetes (for QA). We store the access token in a kubernetes secret, but since the access token usually expires after 24h, causing a lot of troubles in QA, I'm trying to find a way to refresh this token automatically from within kubernetes.
    – Nicholas
    Commented Jul 30, 2021 at 16:31
  • 1
    I'm suspecting the issue is that sfdxAuthUrl is not available when the devhub is authenticated with the jwt flow.
    – Nicholas
    Commented Jul 30, 2021 at 16:44

1 Answer 1

1

Basically, sfdxAuthUrl works only if you authenticate with force:auth:web:login.

Reference: How to login to a ScratchOrg that was created by CI/CD scripts?

You must log in to answer this question.

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