How to enable a CredFile to be used instead of Username/Password combo for API scripts (12.1 and above ONLY)

How to enable a CredFile to be used instead of Username/Password combo for API scripts (12.1 and above ONLY)

92
Created On 11/10/26 10:55 AM - Last Modified 11/10/26 15:59 PM


Objective


How to enable a CredFile to be used instead of Username/Password combo for API scripts (12.1 and above ONLY)

Environment


12.1;12.2;12.6;13.0 Privileged Access Manager (PAM, self-hosted) Cyber-Ark API/SDK

Procedure


IMPORTANT NOTE: This article is for version 12.1 ONLY. If you are on version 12.0 or below, please follow this article instead

1. Create a user in the vault using the GUI. Make sure to it has access to the PVWA. Restrict its permissions to the minimum necessary based on the actions you are going to take.
2. Using a command line go to the PVWA install folder and navigate to the Env folder.
- Run "CreateCredFile.exe WSUser.ini Password /Username {username} /Password {password} /AppType PVWAApp /ExePath "c:\windows\system32\inetsrv\w3wp.exe" /EntropyFile /DPAPIMachineProtection"
- Enter for {username} the username of the user created in step 1
- Enter that username's password in {password}
3. Take the WSUser.ini file and the WSUser.ini.entropy file created in the Env folder, cut it, and place it in the CredFiles folder of the PVWA install folder
4. Open and edit the Web.config file located in the Inetpub\wwwroot\PasswordVault folder.
- paste the following line in the appSettings section:
<add key="WSCredentialFile" value="C:\CyberArk\Password Vault Web Access\CredFiles\WSUser.ini"/>
- Make sure the file path is correct, the path provided is the default path
- Save Web.config
5. Use the REST API shared logon method (not the standard logon method !) - it will return a token, that you will be able to use in your next method (similar to the standard logon method).


Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000001966CAA&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail