Get the auth fields (decrypted) needed to make a connection.
OptionalclientApp: string
Name of the CA/ECA associated with the user.
Get the authorization fields.
Optionaldecrypt: boolean
Decrypt the fields.
Returns a ReadOnly object of the fields. If you need to modify the fields, use AuthInfo.update()
Get the SFDX Auth URL.
Get the username.
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
Initializes an instance of the AuthInfo class.
Returns true if this is using an access token flow.
Returns true if this is using the JWT flow.
Returns true if this is using the oauth flow.
Returns true if this is using the refresh token flow.
Returns true if this org is using access token auth.
Updates the cache and persists the authentication fields (encrypted).
OptionalauthData: AuthFields
New data to save.
Sets the provided alias to the username
alias to set
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.
Update the authorization fields, encrypting sensitive fields, but do not persist.
For convenience this object is returned.
OptionalauthData: AuthFields
Authorization fields to update.
StaticgetGet the authorization URL.
The options to generate the URL.
Optionaloauth2: OAuth2StaticgetReturns the default instance url
StaticgetFind all dev hubs available in the local environment.
StatichasReturns true if one or more authentications are persisted.
StaticidentifyGiven 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.
StaticlistGet 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.
StaticparseParse a sfdx auth url, usually obtained by authInfo.getSfdxAuthUrl.
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