While testing Credentials return Error "JSON JSONObject text must begin with '{' at character 1"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2023 08:27 AM
I have installed Mid Server and its status is up and validated. Tried to test the credentials for windows by providing the system username, password and mid server details, Credentials are not being validated and throwing the below error as:
"A JSONObject text must begin with at character 1".
Have also followed the KB article (KB0693863 ) still facing the same issue.
laptop configuration on which Mid Server installed: Windows 12th Gen, 8GB RAM, Core I5
Please help on this. Thanks in Advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2023 08:14 AM
Hello @Hussain124,
The error message that you are getting in your MID Server is “A JSONObject text must begin with at character 1”. This means that the JSON data that is returned by the external system or device is not valid or well-formed. JSON (JavaScript Object Notation) is a data format that is used to exchange information between systems.
According to the web search results, some possible causes and solutions for this error are:
- You may have some extra or missing characters at the beginning or the end of the JSON data, such as {, }, [, ], or ". You should remove or add them accordingly to make sure the JSON data is well-formed.
- You may have some invalid characters or encoding in the JSON data, such as &, <, >, or UTF-8. You should replace them with their corresponding JSON entities, such as \u0026, \u003c, \u003e, or \u00e9. Alternatively, you can use a tool, such as [JSON Escape], to escape or unescape the JSON data.
- You may have some incorrect settings or parameters in your MID Server configuration, such as the endpoint URL, the authentication type, the headers, or the payload. You should check and verify that they are correct and consistent with the external system or device.
To fix your MID Server issue, you can try the following:
- If you are using a REST message to test the credentials for Windows, you should check the REST message settings and make sure they are correct and consistent with the Windows system. For example, you should check the HTTP method, the endpoint URL, the authentication type, and the headers.
- If you are using a PowerShell script to test the credentials for Windows, you should check the PowerShell script and make sure it is valid and returns a valid JSON data. For example, you should check the syntax, the parameters, and the output format of the script.
- If you are using a Discovery credential to test the credentials for Windows, you should check the Discovery credential settings and make sure they are correct and consistent with the Windows system. For example, you should check the credential type, the user name, the password, and the domain of the credential.
I hope this helps
Kind Regards,
Swarnadeep Nandy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2023 08:20 AM
Hi @Hussain124 ,
Please have a look at KB article from servicenow.
Test credentials return error "JSONObject text must begin with '{' at character 1"
From Article :
Resolution
- Make sure the mid server windows service "Log on as" account is either a local admin account, or has full permission to mid server folder.
- If point 1 is verified, please proceed following steps
- On MID server host, stop MID server windows service
- For pre-Rome release, Delete the keystore file in agent/keystore folder. For Rome release, Delete the keystore file in agent/security folder.
- Open config.xml and remove the keystore value. i.e:
<parameter name="keypairs.mid_id" value=""/>
- In config.xml, locate parameter mid.instance.password, empty the value, then enter mid server user's password in clear text (it will be re-encrypted automatically when MID server service starts)
- Start MID server windows service
- The mid server will start up as not validated. Click the validate link and the MID server should restart and then validated.
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 09:12 PM
Hi Gunjan -
I have verified all items in your resolution and also deleted the keystore folder... and still receive the error. I have also gone one additional measure and just re-configured the MID server and still receiving the same error.
When a scheduled Discovery runs we do not see errors similar or even the same... this only occurs when testing a credential from the appropriate credential record. Furthermore, we have only seen these errors in our lower environments, however config for the MIDs in lower environments is identical to PROD, credentials used are identical to PROD as well. Any help is appreciated!
Any other ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 05:06 AM
FWIW, I had a similar issue in test after cloning from our prod instance and upgrading to Xanadu, and simply rekeying our MID servers in the UI fixed the problem.