No Results
Set Credential for User

EdgeCore version: 4.3.0

Method

PUT /public/users/{userName}/credentials/{credentialName}

Used to set a particular credential for a specific user.
Note that the credential in question needs to be configured on the Provision Defaults page.

Parameters

Name Type Description Mandatory
userName
string Username of the user Yes

If domain name is not included (userName@domainName), it assumes the default domain.

credentialName
string Credential name you want to set for the user Yes
inherited
boolean Specifies whether the secured variable inherits the default value.

If true, the credential is reset to inherit the default value.

No
username
string literal or expression string (e.g. info.login.username) Credential username

If you are using an expression, set userIsExpr to true.

Yes, if credential type is either Username & Password, or Username, Domain, & Password
userIsExpr
boolean Specifies whether the username is an expression

If username is an expression, set this value to true.

No
domain
string literal or expression string (e.g. info.login.domain)

 

Domain of the credential

If you are 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 the domain is an expression

If the domain is an expression, set this value to true.

No
password
string literal or expression string (e.g. info.login.password) Password of the credential

If you are using an expression, set passIsExpr to true.

Yes, if credential type is either Username & Password, or Username, Domain, & Password
passIsExpr
boolean Specifies whether the password is an expression

If the password is an expression, set this value 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/users/jane/credentials/TestCred' \
--header 'edgeApiKey: YWRtaW5AZGVmYXVsdHx3IDNHe2tMZTYhMkZkO3J3cipDaSZUdio5' \
--form 'inherited=false' \
--form 'username=bestuser' \
--form 'userIsExpr=false' \
--form 'domain=test' \
--form 'domainIsExpr=false' \
--form 'password=pass'

Example Response

{
    "userId": "9uvkg2-h266vjk3v3fb",
    "userName": "jane",
    "domainId": "9uvkg2-h266vjk3uc90",
    "doClass": "UserSecVarValueDO",
    "id": "bnc7r3-k9rmpkhprpga",
    "varName": "TestCred",
    "value": {
        "doClass": "CredentialSetDO",
        "isParameter": false,
        "credentials": [
            {
                "doClass": "CredentialPairDO",
                "key": "Username",
                "value": {
                    "doClass": "SpStringValueDO",
                    "isParameter": false,
                    "primitiveValue": "bestuser"
                },
                "hidden": false,
                "required": false
            },
            {
                "doClass": "CredentialPairDO",
                "key": "Password",
                "value": {
                    "doClass": "SpEncryptedStringValueDO",
                    "isParameter": false,
                    "plainValue": "UNUSED",
                    "encryptedValue": "#default!Xtb5VSKgiOVloPU7gxl+Kt3DmfzsdaJ0tnrzOq6PNiE="
                },
                "hidden": true,
                "required": false
            }
        ]
    },
    "inheritedValue": null,
    "inheritedValueScope": null
}

HTTP Response

Code Status Description
200 OK The request has succeeded.
400 Bad Request Missing required value for one of the credential fields
404 Not Found The credential could not be found.

Or

The user could not be found.

 


Terms | Privacy