- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 04:27 AM
Using ServiceNow HTTP Table API, is is possible to update credential fields? How can I encrypt the password? On the request body or can ServiceNow Encrypt?
For example: I need to update table "ldap_server_config" field "password". I've done the following:
PUT https://{instance_url}/api/now/table/ldap_server_config/{sys_id}
HEADER
{auth header stuff}
BODY
{
"passowrd": "123456"
}
This goes through with no issues, but the password is not encrypted. I know this by running the script below on the instance:
var gr = new GlideRecord('ldap_server_config');
gr.get('eecd75a30a0a0b2600791193785025b2');
gs.log(gr.getValue('password'));
// log output: *** Script: 123456
// field content has not been encrypted
What needs to be done to encrypt this password using http table api?
Why?
In my company, credentials are routinely rotated. When that happens, I have to launch ServiceNow and update the password manually. e.g. table ldap_server_config and update the "password" field. This is a manual step and prone to error. The ldap_server_config is just one example. There are several other credentials that I'd like to automate the password rotation.
I have written a PowerShell script that grabs latest credentials and updates ServiceNow tables using table API explained above. The problem is that the credentials are not encrypted and do not work as expected.
Help please 🙂
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 02:31 AM
I've raised a hi ticket and got the answer. For future reference, this is that needs to be done:
"You need to add "sysparm_input_display_value=true" in the resource path"
An example:
PUT https://{instance_url}/api/now/table/ldap_server_config/{sys_id}?sysparm_input_display_value=true
HEADER
{auth header stuff}
BODY
{
"passowrd": "123456"
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 02:31 AM
I've raised a hi ticket and got the answer. For future reference, this is that needs to be done:
"You need to add "sysparm_input_display_value=true" in the resource path"
An example:
PUT https://{instance_url}/api/now/table/ldap_server_config/{sys_id}?sysparm_input_display_value=true
HEADER
{auth header stuff}
BODY
{
"passowrd": "123456"
}