Script Credentials
Overview
Credentials are not required when using the Script functionality in DataBlend, but a script can reference credentials that have been set up in the User’s group. These can be referenced in Script Collectors, Script Data Targets and Script Tasks.
The guid-of-credential can be found in the URL of the credential being referenced:
Configuration
| Field Name | Required / Optional | Description |
| Name | Required | Provide a unique name for this credential. |
| Authentication Type | Required | Determines how the credential authenticates. Select one of the following: Basic: Stores a Username and Password for use in scripts. No API call is made at the time the credential is created — values are stored securely and referenced by a script at runtime. Reveals the Username and Password fields only. OAuth: Connects to an API using an OAuth 2.0 authorization flow. Reveals the Flow Type, Authorization URL, Token URL, Scope, Client ID, Client Secret, Access Token, and Refresh Token fields. |
| Username | Required, only for Basic Authentication | The username to be stored and referenced by the script. Only visible when Authentication Type is set to Basic. |
| Password | Required, only for Basic Authentication | The password to be stored and referenced by the script. Only visible when Authentication Type is set to Basic. |
| Flow Type | Optional, only for OAuth Authentication | The OAuth 2.0 grant type to use. Select one of the following: Authorization Code: The standard OAuth flow that redirects the user to the provider's login page to authorize access. Use for APIs where a user must grant consent. Client Credentials: A server-to-server flow that authenticates using only the Client ID and Client Secret, without user interaction. Use for APIs that support machine-to-machine authentication. |
| Authorization URL | Required, only for OAuth Authentication | The authorization endpoint URL for the OAuth 2.0 provider. Only visible when Authentication Type is set to OAuth. |
| Token URL | Required, only for OAuth Authentication | The token endpoint URL for the OAuth 2.0 provider. Only visible when Authentication Type is set to OAuth. |
| Scope | Optional, only for OAuth Authentication | The OAuth scope(s) to request. Enter space-separated values if multiple scopes are required. Only visible when Authentication Type is set to OAuth. |
| Client ID | Required, only for OAuth Authentication | The Client ID issued by the OAuth provider. Only visible when Authentication Type is set to OAuth. |
| Client Secret | Required, only for OAuth Authentication | The Client Secret issued by the OAuth provider. Only visible when Authentication Type is set to OAuth. |
| Access Token | Optional, only for OAuth Authentication | An existing access token, if available. DataBlend will use this token to authenticate API requests and refresh it automatically when it expires. Only visible when Authentication Type is set to OAuth. |
| Refresh Token | Optional, only for OAuth Authentication | An existing refresh token, if available. Used to obtain a new access token when the current one expires. Only visible when Authentication Type is set to OAuth. |
OAuth Redirect:
When creating a Script Credential and connecting to an API with OAuth 2.0 the system will request a URL to redirect the response to. Below are the redirect path.
(US) - https://ml.datablend.com/api/plugins/script/oauth/authorized
(UK) - https://ml.datablend.co.uk/api/plugins/script/oauth/authorized

