We have been working on a series of agents (that run RPA bots) and for one reason or another, we have built a process that allows them to restart themselves using an api call to their /flows endpoint.
The restriction we are currently facing is that in order to call this endpoint, we are required to provide a bearer token for authorization, however, as far as I could tell, the only way I can obtain this bearer token is by redeploying the flow and manually pulling the token out of the network view.
The alternative to this is that we can change the adminAuth setup in the settings.js file from ‘strategy’ to ‘credentials’ which will allow us to use a username and password for the api call rather than a bearer token.
Are you aware of any issues in the OpenFlow / OpenRPA / Node-RED space that we could face if we do change the adminAuth setup? i.e., would it affect Node-RED’s ability to interact with OpenFlow or OpenRPA?
That will not work. But if the NodeRED is not published to the outside world, you can disable auth completely by leaving admin_role empty.
An alternative is to add a custom endpoint in main.js that calls RED.nodes.loadFlows(true);
Oh, you’re right, I forgot I made users the default.
Then you are right. You will need to update the code, and remove the part that sets settings.adminAuth (or wrap it in an if statement that only sets it if process.env.admin_role has been set).
Once we have modified the code, how do we get the new version into the product? Whenever we attempt to modify the agent_images (NoderedImage[]) in config, the agents dropdown goes to a large list of “undefined”, even if we just use the default json string. its like any string is not being recognised other than when it is unset default. we have double checked JSON syntax etc, what is the next step to debug this issue?
HI Allan, we have got the auth working as per your suggestion, but cannot use the agent as we cannot update the custom string to allow it to be used as per above. Do you have any options to either fix that JSON/ variable issue or something else we can do to allow us to access the Agent?
I don’t know what is wrong with your json. The webpage will ignore the content, if the json is not valid. Are you running an instance of opencore you built yourself, or using one of the official docker images ?
We are running v1.5.10.62 - official version. the json we tested with is the defaultvalue json listed in the unset page and checks out in a JSON viewer. this is the json (copied from the default for agent_images in the unset page)
we have tried upgrade to latest but we have aws load balancer doing cert proxy and auth does not work with traefik due to http/https issue. this has not been able to be resolved so far. This was the last version that worked for us.