Unable to Connect Using Basic Authentication : Says Invalid Credentials

 

This is my first time using Anaplan Connect 

 

My Batch File 

 

@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="sripad.lokapure@abc.com"
set WorkspaceId="8a81b09b551d26df01554fc9454b4072"
set ModelId="CCCFC60814F543AE815FB720245C3B0A"
set Operation=-file "employee.csv" -put "C:\Anaplan_test\employee.csv" -import "Employee_List from employee.csv" -execute -output "C:\Anaplan_test\My 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

 

After running this batch file it asks me for 

 

Anaplan Auth-Service URL:

 

I tried entering :

https://api.anaplan.com 

:https://auth.anaplan.com

and the sdp.frontdoor URL

 

But it always says credentials are invalid

Can you Guide me where I am going wrong

 

Thanks

 

Regards

 Sripad 

Answers

  • Hi,

     

    Best practice would be to hard-code the auth and service URLs directly into the Command variable:

     

    set ServiceUrl="https://api.anaplan.com"

    set AuthUrl="https://auth.anaplan.com"

     

    set Command=.\AnaplanClient.bat %Credentials% -service %ServiceUrl% -auth %AuthUrl% -workspace %WorkspaceId% -model %ModelId% %Operation%

     

    Make these changes and try using your username and password again, and let us know whether you're able to successfully authenticate.

  • Hi

    Thanks for your response I tries as you said I'm getting a 404 error when trying to login

    Please find the console info below

     

    .\AnaplanClient.bat -user "sripad.lokapure@gartner.com" -service "https://api.anaplan.com" -auth "https://auth.anaplan.com" -workspace "8a81b09b551d26df01554fc9454b4072" -model "CCCFC60814F543AE815FB720245C3B0A" -file "employee.csv" -put "C:\Anaplan_test\employee.csv" -import "Employee_List from employee.csv" -execute -output "C:\Anaplan_test\My Errors.txt"
    Absolute path to JAVA 8 executable not provided. Will attempt to figure out path from JAVA_HOME or Windows registry...
    JAVA_HOME is not defined, will attempt to fetch value from registry...
    Checking Windows Registry for Java Version...
    Checking Windows Registry for JAVA_HOME...
    JAVA_HOME is C:\Program Files\Java\jre1.8.0_211
    Found Java executable from JAVA_HOME , at C:\Program Files\Java\jre1.8.0_211\bin\java.exe...
    Current Java version = 1.8
    Current Java version is valid for Anaplan Connect.
    Running Anaplan Connect...
    Using Class-Path: C:\Anaplan_Connect\anaplan-connect-1.4.1-jar-with-dependencies.jar
    Password:
    2019-05-09 07:48:46 [32mINFO [0;39m [35m16128[0;39m |-- Initializing Service...
    2019-05-09 07:48:46 [32mINFO [0;39m [35m16128[0;39m |-- Authenticating via Basic...
    2019-05-09 07:48:50 [1;31mERROR[0;39m [35m16128[0;39m |-- Server files not found: Server-Files not found for Model-ID=CCCFC60814F543AE815FB720245C3B0A (Feign: status 404 reading AnaplanAPI#getServerFiles(String,String,int); content:
    {
    "status": {
    "code": 404,
    "message": "Resource not found"
    }
    })
    Press any key to continue . . .

     

    Thanks

     

    Regards

     Sripad Lokapure

  • Hi

    Thanks for your response I tries as you said I'm getting a 404 error when trying to login

    Please find the console info below

     

    .\AnaplanClient.bat -user "sripad.lokapure@gartner.com" -service "https://api.anaplan.com" -auth "https://auth.anaplan.com" -workspace "8a81b09b551d26df01554fc9454b4072" -model "CCCFC60814F543AE815FB720245C3B0A" -file "employee.csv" -put "C:\Anaplan_test\employee.csv" -import "Employee_List from employee.csv" -execute -output "C:\Anaplan_test\My Errors.txt"
    Absolute path to JAVA 8 executable not provided. Will attempt to figure out path from JAVA_HOME or Windows registry...
    JAVA_HOME is not defined, will attempt to fetch value from registry...
    Checking Windows Registry for Java Version...
    Checking Windows Registry for JAVA_HOME...
    JAVA_HOME is C:\Program Files\Java\jre1.8.0_211
    Found Java executable from JAVA_HOME , at C:\Program Files\Java\jre1.8.0_211\bin\java.exe...
    Current Java version = 1.8
    Current Java version is valid for Anaplan Connect.
    Running Anaplan Connect...
    Using Class-Path: C:\Anaplan_Connect\anaplan-connect-1.4.1-jar-with-dependencies.jar
    Password:
    2019-05-09 07:48:46 [32mINFO [0;39m [35m16128[0;39m |-- Initializing Service...
    2019-05-09 07:48:46 [32mINFO [0;39m [35m16128[0;39m |-- Authenticating via Basic...
    2019-05-09 07:48:50 [1;31mERROR[0;39m [35m16128[0;39m |-- Server files not found: Server-Files not found for Model-ID=CCCFC60814F543AE815FB720245C3B0A (Feign: status 404 reading AnaplanAPI#getServerFiles(String,String,int); content:
    {
    "status": {
    "code": 404,
    "message": "Resource not found"
    }
    })
    Press any key to continue . . .

     

    Thanks

     

    Regards

     Sripad Lokapure

  • Hi @sripadlokapure,

     

    Does your workspace have Single Sign-On, if so you'll need to make yourself an exception user or you won't be able to authenticate with our auth server to use Anaplan Connect.

     

    If that's not the case, please contact our Support team. I did some investigation and see that everything else checks out, so you should be able to access this model as long as you're not using SSO.

     

    Thanks

  • this worked when I tried on the previous 1.3 version

     

  • Hi Sripad,

     

    I faced the same issue, however I have modified my script. 

    I have declared a variable set AuthUrl="https://auth.anaplan.com"  and in the set operation, added -auth %AuthUrl%. You can directly add the URL under operation. 

     

    Following is my script:

     

    @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 AuthUrl="https://auth.anaplan.com"
    set AnaplanUser="User ID:Pswd"
    set WorkspaceId="abcd...."
    set ModelId="1234...."
    set Operation= -auth %AuthUrl% -file "P3.csv" -put "Local File Location" -import "Anaplan action name" -execute -output "Local file location"
    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

     

    This worked fine for me. Please try this and let me know if you have any questions.

     

    Thanks,

    Ramana

  • It does not seem an authentication issue here... but in your Anaplan model in "Actions"->"Import Data Source" there is NO "Source Type"  FILE named as  "Employee_List from employee.csv"