Skip To Content

esri_credential_set (AutoLISP)

Set credentials to a service for the current AutoCAD session. It is required to specify a specific service layer in the method, but secured layers added from the same server in the same AutoCAD session will use those credentials, if needed. This only works on token authentication for ArcGIS Server and ArcGIS Enterprise, not on other authentication models such as OAuth. User name and password is passed in plain text to the server.

Syntax

(esri_credential_set url username password)

Arguments

  • url | string | required | URL path to a valid web feature layer.
  • username | string | required | Existing user name with permission to access the layer.
  • password | string | required | Password for the specified user name.

Example usage

Attempts to set the token authentication user name and password credentials for the included web feature layer

(esri_credential_set 
"https://myserver.domain.com/arcgis/rest/services/mySecuredLayer/FeatureServer/0"
"JoeGISUser2020"
"JoesPassword")

Result example usage

Sets the token authentication user name and password credentials for the specified web feature layer and returns a list of true:

(T)

Return values

  • If successful the function returns a list of true: (T)
  • If failed, returns a list with the first value of nil and then an associated list containing the key value "Error" and an associated error message as a string: (nil ("Error" . "<message>"))

Failed return values

A failed return value can occur for any of the following reasons:

  • (nil ("Error" . "Invalid parameter type"))

    Invalid parameters, or general failure.

  • (nil ("Error" . "Missing required argument."))

    One or more of the required arguments was not supplied.

  • (nil ("Error" . "Too few arguments"))

    Invalid parameters, or general failure.

  • (nil ("Error" . "Failed."))

    Invalid URL and or credentials.