Anaplan Connect - Could not load the privateKey for authentication.
I'm trying to connect to Anaplan through Anaplan Connect tool using a Sectigo Certificate.
I'm able to connect using an hard coded credentials (user:pass) but when trying to connect via Certificate I'm facing the error below.
Note: I have received an "user.crt" file from Sectigo on which I ran the following openssl code to get the private key:
openssl x509 -inform der -in user.crt -out certificate.pem
@Echo on rem This example loads a source text file and runs an Anaplan import into a module. rem For details of how to configure this script see doc\Anaplan Connect User Guide.doc
set certificate="C:\Anaplan\anaplan-connect\certificates\certificate.pem" set WorkspaceId="8a81b09459" set ModelId="61XYZA7" set Operation=-file "Employee.txt" -put "C:\Users\User\Downloads\Employee.txt" -import "New Hire from Employee.txt" -execute -output "C:\My Errors.txt"
rem *** End of settings - Do not edit below this line ***
setlocal enableextensions enabledelayedexpansion || exit /b 1 cd %~dp0 set Credentials=-certificate %certificate% set Command=.\AnaplanClient.bat %Credentials% -workspace %WorkspaceId% -model %ModelId% %Operation% @Echo %Command% cmd /c %Command%
Re: Anaplan Connect - Could not load the privateKey for authentication.
Thanks for your quick reply,
The error that I'm getting is detailed below:
Running Anaplan Connect... Using Class-Path: C:\Anaplan\anaplan-connect\anaplan-connect-1.4.4-jar-with-dependencies.jar 2020-06-23 18:55:54 ERROR 14272 |-- Anaplan API: Could not initialise service credentials (Runtime: Could not load the privateKey for authentication. Please check the privateKey parameters in your input.)
I will have a look into the interactive guide that you shared.
Under User Details, complete the fields to specify Email Address, Forename, Surname. Under Advanced Security Options, accept the pre-populated default values. Under Login Credentials, set a Username, and Password. Confirm the password. Click Place Order.
It seems like the issue is because you are not referencing the private key at all in the script. In the successful scripts that I have run on 1.4.4, you have to 'set' the public certificate (what you already have) and set the private key. See the example below.