Create new instance.
Unique identifier for the credentials
Optional
description: stringOptional description
Call this function after configuring, but before using host, username or password properties of a credential. If the credential object has not be previous authorized, the user will be prompted to enter their credentials before continuing. If the user has previously been prompt, this method will load previously provided information.
Static
createCreate a credential object with the specified identifier and description. Identifiers should be unique, such that any two calls from different actions with the same identifier will return the same credentials
Unique identifier for the credentials
Optional
description: stringOptional description
Static
createCreate credential already configured with host url, username and password fields.
Unique identifier for the credentials
Optional description
Static
createCreate credential already configured with username and password fields.
Unique identifier for the credentials
Optional description
Credential objects can be used in actions which require the user to provide a username, password and optionally a host name, to connect to a service. By using credentials objects, actions can be written to connect to arbitrary web services without hard coding credentials into the action.
When an authorize() call is made on a credential object for the first time, the user is prompted to enter their credentials, then Drafts stores those for later use. When the action is used again, there will be no prompt required and the stored credentials will be used.
Credentials objects have unique identifiers, and a single set of user credentials can be used across actions by using the same identifier.
The user can delete those credentials at any time by visiting Settings > Credentials and tapping the "Forget" button on a service.
Example