Get the auth fields (decrypted) needed to make a connection.
Optional clientApp: stringName of the CA/ECA associated with the user.
Get the authorization fields.
Optional decrypt: booleanDecrypt the fields.
Returns a ReadOnly object of the fields. If you need to modify the fields, use AuthInfo.update()
Convenience function to handle typical side effects encountered when dealing with an AuthInfo. Given the values supplied in parameter sideEffects, this function will set auth alias, default auth and default dev hub.
instance of AuthSideEffects
Updates the cache and persists the authentication fields (encrypted).
Optional authData: AuthFieldsNew data to save.
Set the target-env (default) or the target-dev-hub to the alias if it exists otherwise to the username. Method will try to set the local config first but will default to global config if that fails.
Optional devOptional org?: booleanUpdate the authorization fields, encrypting sensitive fields, but do not persist.
For convenience this object is returned.
Optional authData: AuthFieldsAuthorization fields to update.
Static getGet the authorization URL.
The options to generate the URL.
Optional oauth2: OAuth2Static getStatic getFind all dev hubs available in the local environment.
Static hasStatic identifyGiven a set of decrypted fields and an authInfo, determine if the org belongs to an available dev hub, or if the org is a sandbox of another CLI authed production org.
Static listGet a list of all authorizations based on auth files stored in the global directory. One can supply a filter (see
A predicate function that returns true for those org authorizations that are to be retained.
Static parseParse a sfdx auth url, usually obtained by authInfo.getSfdxAuthUrl.
await AuthInfo.create(AuthInfo.parseSfdxAuthUrl(sfdxAuthUrl));
Handles persistence and fetching of user authentication information using JWT, OAuth, or refresh tokens. Sets up the refresh flows that jsForce will use to keep tokens active. An AuthInfo can also be created with an access token, but AuthInfos created with access tokens can't be persisted to disk.
See Authorization
See Salesforce DX Usernames and Orgs