APP: I am making a simple desktop app for users to register some data. The app uses an API to an external system where the data needs to be stored.
Problem: The API call contains a key. That key gives total access to all the data in the external system. Some users might have the access anyways, but i don't want to risk that other people gets a version of the app and through that obtains the key.
Question: Should i have the API call in the main process or the renderer?
Considerations:
- Either way the https request will include the token and come from the users computer. So users could get hold of the token no matter from where the API gets called.
- I can make it more difficult to find the https request if it is from the renderer by disabling devtools.
- It just feels wrong to make the API call with secret key from the renderer, but i can't see the security difference.
- The code is just nicer and simpler if the API gets called from the renderer
- The app really needs to be as simple as possible, authentication of user is no-go
- Adding a microservice hosted on a server, that connects electron app and the external system gives the opportunity to hide the key and limit what calls can be made. However the hosting will be challenging because of restrictions on where the data can be transferred.
- I could add a hard coded limitation to which OS users (reading username from the OS) can use the app, however this will make it much harder to add or remove users.
- The computers where the app will be installed are only to be used by staff and requires personal credentials to login on the system. Which should be a barriere that limits the access to the app and the possibility to copy the app to another computer.
What do you guys think?
Is it stupid of me to compromise security and make the call directly from the app?
Is there any difference by making a call from the main proccess and the renderer process?
What is best practice and what is acceptable practice?