Has there been any thought to setting the password for the default scratch org users? Is it possible that OAuth token persistence is required because the default scratch org user has no password, therefore requiring OAuth for even GUI access?
Maybe adding a password parameter to the org:create command?
Maybe some options like this?
sfdx force:org:create --password MyPassword
Some flows might look like this:
- POST https://[DevHubOrgDomain].my.salesforce.com/services/data/v51.0/sobjects/ScratchOrgInfo to create scratch org
- GET https://[ScratchOrgDomain].my.salesforce.com/services/oauth2/authorize to get authorization_code
- POST https://[ScratchOrgDomain].my.salesforce.com/oauth2/token to get refresh token and initial access token
- POST https://[ScratchOrgDomain].my.salesforce.com/services/Soap/s/ to APEX Soap API to set user password using Apex
system.setPassword method
All of these steps could be executed in on script without the need to persist tokens.
Has there been any thought to setting the password for the default scratch org users? Is it possible that OAuth token persistence is required because the default scratch org user has no password, therefore requiring OAuth for even GUI access?
Maybe adding a
passwordparameter to theorg:createcommand?Maybe some options like this?
sfdx force:org:create --password MyPasswordSome flows might look like this:
system.setPasswordmethodAll of these steps could be executed in on script without the need to persist tokens.