how to add user authentification to node red from a webpage that run on the same server

I have a server and i have node-red running on it, i know how to create user authentification by editing setting.js file but what i want to do is that i want to be able to create other users from a webpage that is running on the same server. I can run a python script that edit the setting.js file and i can edit it mannualy, but i want to be able to create and remove users from the webpage that is running on the same server. i am using ubuntu and ngninx on my server.