LDAP authentication command for HomeAssistant
- Add the compiled result to your HomeAssistant install
- Configure the command line auth provider in HomeAssistant (
see here) to use this tool.
homeassistant:
auth_providers:
- type: command_line
command: /opt/hass-ldap-authenticator # Assuming you copied the binary to this path
args:
- "--url"
- ldaps://auth.foo.bar
- "--base-dn"
- dc=auth,dc=foo,dc=bar
- "--bind"
- "--bind-user"
- cn=ldap-bind,ou=service,dc=auth,dc=foo,dc=bar
- "--bind-password"
- FooBarTopSecret
- "--user-filter"
- "(&(objectClass=user)(uid=%s))"
meta: true
- type: homeassistant
Name |
Meaning |
Required |
--url string |
URL of LDAP server |
yes |
--starttls |
Use StartTLS |
no |
--base-dn string |
Base DN to search |
yes |
--bind |
Use authenticated Bind |
no |
--bind-user string |
DN of Bind User |
When authenticated bind is required |
--bind-password string |
Password of Bind User |
When authenticated bind is required |
--user-filter string |
Filter to apply for search. Put %s where you expect username |
yes |
--displayname-attribute string |
LDAP attribute that contains the name that should be shown in HomeAssistant |
defaults to displayName |
Name |
Meaning |
Required |
username |
Username to authenticate |
Set by HomeAssistant |
password |
Password to authenticate |
Set by HomeAssistant |