Overview
This will describe a proposed addition to Home Assistant to add multi user authentication and authorization. Home Assistant (Hass) up to this point has focused on the single user use case. It expects all users of a system to authenticate with the same credentials. Some user stories to get started:
-
An owner of a Hass setup would like to remove all the extra features and panels from their spouse, giving them access to just controlling the components they care about.
-
An owner would like to prevent their roommate from being able to turn their bedroom lights on and off, but still give them access to controlling the common room lights.
-
An owner would like to delegate authentication to a third party (OpenId / OAuth provider).
Glossary
Authentication - The act of a user presenting credentials and verifying they are who they say they are.
Authorization - The act of asserting that an authenticated user can do a specific action.
Admin - A entity in Hass that has no limit on there permissions (akin to root in Linux)
User - A entity in Hass that can get restricted access to components within the system.
Web Interface changes
The default home assistant experience will go unchanged. The default, unauthenticated web page will give users an easy on boarding. If auth is enabled on your home assistant instance, you will be required to login to the server. Bootstrapping the user database requires Hass be launched in a trusted environment. That is, the first person to connect to the server in “auth” mode gets to set up the first user. From there, the first user can add new users as needed. This would be accomplished through the “Admin Users” panel. Users can also be set to “Admin” in this panel, to allow for more than one Admin.
There will be an option in the “Admin Users” panel to delegate authentication to a reverse proxy. This would allow advanced users to set up a proxy in front of there Hass server to authenticate users. If this option is selected, only user names are needed to be populated in the “Admin Users” panel, passwords would not be required.
There will be a “User” panel that will allow individual users to manage their own passwords. There could be other information in this panel, mobile number, email address, etc. for notifications.
There will be a “Admin Permissions” Panel that will allow Admins to set permissions on users. Admins would be able to check an uncheck the components that the users have access to view and modify.
I’d like to get feedback on this, both features that people would be looking for and areas in the code base to look into to add these features.