You can store credentials for accessing external systems via scripting in Setup ->Security --> Credential Management.
This page contains all credentials that are currently stored in the environment. When you store a credential entry, you can cite its name in the script sent to an external system, to perform user authentication, instead of using more complex authentication methods.
A single credential entry consists of a name, identifier, and a password or a client secret.
Name- The value used for distinguishing one credential entry from others.
Identifier- A unique identifier of a credential, usually consisting of a username and a domain name.
Secret- A password or a client secret. Once the creation of an entry is complete, the secret becomes encrypted and can no longer be seen by you or other administrators.
Active- Status of a credential entry. You can temporarily make a credential entry inactive, preventing its use for authentication in scripts.
AuthorizedRestClient Scripting Helper
This helper can be used along with a credential entry name to make basic authentication calls, or for requesting access tokens from external systems (currently only OAuth2 and Client Credential grants are supported.