Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Setting up a txt file as an External Credential Store - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Setting up a txt file as an External Credential Store
KB0714680

Setting up a txt file as an External Credential Store


4593 Views Last updated : Jul 22, 2025 public Copy Permalink
KB Summary by Now Assist

Issue

This article is showing how to set up a text file to be used as a Credential Store for discovery using JDK, which provides more details for product documentation below:

External credential storage configuration

The article is based on working on the MID server host, where the JDK is installed.

Steps

Download the Java Development Kit

Download and install the JDK from Oracle website:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Install it in a folder of your choice.

 

 

Set Windows environment variable to the JAVA bin

We need to modify the "Path" Environment Variable , to point to the JAVA bin folder. In the 'Control Panel/System/Advanced system settings/Advanced/Environment Variable', open ''PATH", then append Value "C:\Program Files\Java\jdk1.8.0_161\bin" (or your path to the java bin folder) at the end.

We also need to set the path to our property file in an environmental variable on the MID server.

This is referred in the java file discussed below. If this is not set, the default path: DEFAULT_PROP_FILE_PATH is used.

 

Create the System Variable CREDENTIAL_RESOLVER_FILE with the value C:/Mid server/Credentials/dummycredentials.properties

 

 

Create the properties file for username/password storage

We are going to store the user credentials in a properties file. Open Notepad and create the property file (make sure Windows is not adding .txt at the end) in a folder of your choice.

In the samples we use

C:\Mid server\Credentials\dummycredentials.properties

 

Add the content from this page (the part of the property file):

https://docs.servicenow.com/csh?topicname=external_cred_storage_configuration.html&version=latest

 

In the property file, add the account that you want to use for discovery.

Format is: 

CREDENTIAL_ID.TYPE.user

CREDENTIAL_ID.TYPE.pswd

 

Here we are adding a Windows user - Note that we need to escape the backslash between domain and username:

disco_user.windows.user=lab01\\administrator

disco_user.windows.pswd=123123

 

Add the user to the credential table in the instance - Note that the first part of the property entry - disco_user - is the credentials id:

 

*** For Rome and San Diego:

Navigate to Vault Configurations - vault_configuration.list

Create a new record using a name associated an imported JAR file for a custom credential resolver, in this example: CredRes

Then on credential form, for the "Credential storage vault" field, pick this newly created vault_configuration CredRes.
 

Create the JAR file

We need to create the JAR file as mentioned in the product doc.

To do this we need to save the code from the doc in a .java file, compile it to a class file, then convert it to JAR file.

Doing this using Eclipse is easier. However when using JDK, we need to follow below steps carefully

 

Open Notepad, copy the content from this page (the part of the java file), paste in Notepad, and save the file as CredentialResolver.java

https://docs.servicenow.com/csh?topicname=external_cred_storage_configuration.html&version=latest

 

On the top of your java file, change the line with the path to your property file:

DEFAULT_PROP_FILE_PATH = "C:/Mid server/Credentials/dummycredentials.properties" 

 

 

Now we need to compile the java to the class. Open the cmd prompt, change folder to c:\Mid server\Credentials and run the following command:

"javac CredentialResolver.java"

 

This will create a CredentialResolver.class in the same folder.

We need to put this class in com.snc.discovery, (as showing in the java file: package com.snc.discovery).

so now you need to create the following folder structure:

C:\Mid server\Credentials\com\snc\discovery

Copy the "CredentialResolver.class "into the "C:\Mid server\Credentials\com\snc\discovery"-folder.

 

===

 

Now we are going to create the JAR file named CredRes.jar (or the name of your choice).

Open the cmd prompt and change folder to c:\Mid server\Credentials and run the following command:

jar cvf CredRes.jar ".\com\snc\discovery\CredentialResolver.class"

 

You can check the content of your JAR-file by running the command:

Jar tf .\CredRes.jar

Confirm the path for the class file is: com/snc/discovery/CredentialResolver.class

 

Your folders should now look like this:

 

 

 

Upload the Jar file

Then we need to upload the Jar file to the ServiceNow instance. MID Server/JAR files and add a new entry and attach the CredRes.jar-file. Don't forget to restart the MID server after you upload a jar file!

You can verify that the CredRes.jar file ended up correctly in the extlib folder on the MID-server.

 

 

 

Test the credential

Go to the credential in the instance that you created earlier and run a 'Test Credential' against an IP where the user has permission.

Verify you get 'Credential Validated'.

Troubleshooting

Check MID Server agent log and wrapper log for debug information.

Release

Quebec, Rome, San Diego


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.