Skip to content

Set ScratchOrg User Password on Create #1230

@JosephAllen

Description

@JosephAllen

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:

  1. POST https://[DevHubOrgDomain].my.salesforce.com/services/data/v51.0/sobjects/ScratchOrgInfo to create scratch org
  2. GET https://[ScratchOrgDomain].my.salesforce.com/services/oauth2/authorize to get authorization_code
  3. POST https://[ScratchOrgDomain].my.salesforce.com/oauth2/token to get refresh token and initial access token
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIssue or pull request for a new feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions