Anaplan API: Basic Authentication failed!

Highlighted
Occasional Contributor

Anaplan API: Basic Authentication failed!

Hi,

I am trying the Anaplan API connector tutorial and I keep getting an Authentication failed error. I have seen a similar question asked but might is particularly strange. Below is my script.

When I include my password in the script I get the failure error.

 

Anaplan API: Basic Authentication failed! (Feign: status 401 reading AnaplanAuthenticationAPI#authenticateBasic(String); content:
{"status":"FAILURE_BAD_CREDENTIAL","statusMessage":"Authentication Failure.

 

Originally my password contained special characters %!.@$ so I changed my password to something simple: Xxxxx9999 where X=an uppercase letter, x=lowercase letter and 9=numeric values. I get the same error.

If i remove the password I am able to enter it when I execute the script and the password passes.

 

@Echo off
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 AnaplanUser="myemail:mypassword"

rem AnaplanUser="myemail"
rem set AnaplanUser=""
set WorkspaceId="8a81b09e5db429f6015dc7d7d78f3354"
set ModelId="3AEDC72497A84687972BE09E67C93559"
set Operation=-service "https://api.anaplan.com" -auth "https://auth.anaplan.com" -file "Pays.csv" -put "C:\anaplan-connect_v1.4.3\data\Pays.csv" -import "Pays from Pays.csv" -execute -output "C:\anaplan-connect_v1.4.3\data\Errors.txt"
rem *** End of settings - Do not edit below this line ***
setlocal enableextensions enabledelayedexpansion || exit /b 1
cd %~dp0
if not %AnaplanUser% == "" set Credentials=-user %AnaplanUser%
set Command=.\AnaplanClient.bat %Credentials% -workspace %WorkspaceId% -model %ModelId% %Operation%
@Echo %Command%
cmd /c %Command%
pause

 

Thanks.

6 REPLIES 6
Highlighted
Master Anaplanner/Community Boss

Re: Anaplan API: Basic Authentication failed!

@Dwight_Babb 

Are you using SSO? If so, you can try turning it off for the ID that you're using.

I know SSO won't work with CA certificates. Same might be true for basic authentication too.


Jared Dolich
Highlighted
Occasional Contributor

Re: Anaplan API: Basic Authentication failed!

No, SSO is not turned on.
Highlighted
Occasional Contributor

Re: Anaplan API: Basic Authentication failed!

I tried the script again with -debug and the password was accepted. I then removed -debug and again the password was accepted.

 

The issue seems to be resolved.

Highlighted
Occasional Contributor

Re: Anaplan API: Basic Authentication failed!

I still can't get it working. As you mentioned in the original post, when I remove the password and enter it at a prompt, it works, but not otherwise.
Highlighted
Community Boss

Re: Anaplan API: Basic Authentication failed!

If your password contains certain characters ( % & < > [ ] { } ^ = ; ! ' + , ` ~) they may be intepreted by the Windows command interpreter. If your password contains non-ASCII characters such as £ this could also be problematic if different character encodings are assumed at different times.

Highlighted
Occasional Contributor

Re: Anaplan API: Basic Authentication failed!

THanks @ben_speight . Is there a workaround , say using an escape character for this ?