I am not able to find any good documentation on .NET SDK for CyberArk.
I am trying to integrate CyberArk password management system to get password for an Outlook account using the below code
PSDKPasswordRequest passReq = new PSDKPasswordRequest();
PSDKPassword password = null;
// What is the purpose of CredFile??
passReq.CredFilePath = "F:\\CredFiles\\AppUser.cred";
passReq.Safe = "SAFE_NAME";
passReq.Folder = "root";
passReq.Object = userName;
passReq.Reason = "Get some stuff done.";
// Sending the request to get the password
password = CyberArk.AIM.NetPasswordSDK.PasswordSDK.GetPassword(passReq);
However I am not able to connect and getting the following error
"PDKTC006E Failed to connect to provider (Reason=[connect command failed])"\
As I understand it, the API (NetPasswordSDK) is actually a caching service that sits between you and the CyberArk appliance. So you have to configure the service correctly during install as it handles the connection to the CyberArk appliance.
Instructions:
On your dev machine, run the CyberArk SDK installer and enter in the IP address and Admin username/password from steps #1 and #2
Assuming the installer completes successfully, it is going to create a user called "Prov_MACHINENAME." (MACHINENAME will equal your NetBIOS hostname) on the CyberArk appliance.
On your dev machine, open C:\Program Files (x86)\CyberArk\ApplicationPasswordProvider\Vault\AppProviderUser.cred and write down the name generated during the install.
You can now use the following code to connect:
PSDKPasswordRequest objPasswordRequest;
PSDKPassword objPassword;
objPasswordRequest = new PSDKPasswordRequest();
objPasswordRequest.AppID = "MyApp";
objPasswordRequest.Safe = "MySafe";
objPasswordRequest.Object = "MyAccount";
objPassword = PasswordSDK.GetPassword(objPasswordRequest);
password = objPassword.Content;
username = objPassword.UserName;