ODK Aggregate replacement - API to share ODK1 forms with ODK Collect

We are developing a web application in Springboot 2.x that will work to collect data using ODK-Collect. I have created API to list all forms and forms are downloaded in ODK Collect. Here is the /formList response template

I want to add authentication to /formList API. I have added springboot security and it authenticate all APIs but now i get error message:
Form listing failed. Parsing failed ...
isConnected failed: ECONNREFUSED (Connection refused) while accessing http://localhost/formList