I’ve been trying to understand how the UI and the Backend communicate with each other, specially when it comes to authentication.
After looking at these diagrams and the code itself, it seems like it’s currently not possible to authenticate in the UI using an username and a password (unless it’s connecting directly to an Edge). Is this correct? If it is, what would be the best way of implementing something like this? I’m thinking of two options here:
- Authenticate from the UI itself using an external authentication service (like Firebase or something similar), and pass the returned session id to OpenEMS Backend.
- Pass the username and password directly to the Backend through the UI websocket, so it can be processed by Metadata.authenticate(username, password), although I’m quite concerned about the security implications of doing that.
My confusion gets worse when I take the Backend Metadata service into account. I understand that it’s supposed to regulate which users can access which devices, but how does this integrate with external authentication services? I’ve looked at the Odoo implementation but it seems to be very targeted to the FEMS infrastructure.
Any tips on how to proceed or any information at all about UI/Backend is more than appreciated.