EdgeCore version: 4.3.0
Method
PUT /public/domains/{domainName}/credentials/{credentialName}
Used to set a particular credential for a specific domain.
Note that the credential in question needs to be configured on the Provision Defaults page.
Parameters
Name | Type | Description | Mandatory |
domainName |
string | Domain for which you want to set the credential | Yes |
inherited |
boolean | If set to true, the credential is reset to inherit the default values | No |
username |
string literal or expression string (e.g. info.login.username) | Credential username
If using an expression, set userIsExpr to true. |
Yes, if credential type is either Username & Password, or Username, Domain, & Password |
userIsExpr |
boolean | Specifies whether username is an expression;
If the username is an expression, set this parameter to true. |
No |
domain |
string literal or expression string (e.g. info.login.domain) | Domain of the credential
If using an expression, set domainIsExpr to true. If the credential does not have a domain field, this parameter is ignored. |
Yes, if credential type is Username, Domain, & Password |
domainIsExpr |
boolean | Specifies whether domain is an expression;
If the domain is an expression, set this parameter to true. |
No |
password |
string literal or expression string (e.g. info.login.password) | Password of the credential
If using an expression, set passIsExpr to true. |
Yes, if credential type is either Username & Password, or Username, Domain, & Password |
passIsExpr |
boolean | Specifies whether password is an expression;
If the password is an expression, set this parameter to true. |
No |
apiKey |
string literal
|
API key string of the credential | Yes, if credential type is edgeCore API Key |
apiKeyIsExpr |
boolean | Specifies whether apiKey is an expression
If apiKey is an expression, set this value to true. |
No |
cURL example
curl --location --request PUT 'http://localhost:8080/public/domains/edge/credentials/credtest' \ --header 'edgeApiKey: YWRtaW5AZGVmYXVsdHx3IDNHe2tMZTYhMkZkO3J3cipDaSZUdio5' \ --form 'username="admin"' \ --form 'password="pass1234"'
Example Response
{ "domainId": "s3pvsu-k636f3lq69pj", "domainName": "edge", "doClass": "DomainSecVarValueDO", "id": "s3pvsu-k636f3lq8ftu", "varName": "credtest", "value": { "doClass": "CredentialSetDO", "isParameter": false, "credentials": [ { "doClass": "CredentialPairDO", "key": "Username", "value": { "doClass": "SpStringValueDO", "isParameter": false, "primitiveValue": "admin" }, "hidden": false, "required": false }, { "doClass": "CredentialPairDO", "key": "Password", "value": { "doClass": "SpEncryptedStringValueDO", "isParameter": false, "plainValue": "UNUSED", "encryptedValue": "#default!CDfFGqe0pBGj2Mw9S0UbjSpJAoGql6HBgAwmV8jKjTGmExw7HKEn5U4Kt7IorxD7" }, "hidden": true, "required": false } ] }, "inheritedValue": { "doClass": "CredentialSetDO", "isParameter": false, "credentials": [ { "doClass": "CredentialPairDO", "key": "Username", "value": { "doClass": "SpStringValueDO", "isParameter": false, "primitiveValue": "admin" }, "hidden": false, "required": false }, { "doClass": "CredentialPairDO", "key": "Password", "value": { "doClass": "SpEncryptedStringValueDO", "isParameter": false, "plainValue": "UNUSED", "encryptedValue": "#default!b2TGdqtLcLcH+oQYVuFCR91mTEmyPd1NGO0URaoDgjd3nYVB59mjJc9TIrEFFg7i" }, "hidden": true, "required": false } ] }, "inheritedValueScope": "DEFAULT" }
HTTP Response
Code | Status | Description |
200 | OK | The request has succeeded.
Additionally, if the domain does not have any content, [] will be returned. |
404 | Not Found | The domain could not be found. |