Unable to Connect Using Basic Authentication : Says Invalid Credentials

Options
sripadlokapure
sripadlokapure Member, ALL USERS Posts: 4 New Contributor

 

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 

Comments

  • sripadlokapure
    sripadlokapure Member, ALL USERS Posts: 4 New Contributor

    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

  • sripadlokapure
    sripadlokapure Member, ALL USERS Posts: 4 New Contributor

    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

  • sripadlokapure
    sripadlokapure Member, ALL USERS Posts: 4 New Contributor

    this worked when I tried on the previous 1.3 version

     

  • Ramana Reddy
    Ramana Reddy Member, ALL USERS, GroupMember, Community Member Posts: 2 New Contributor

    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