Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Newspipe with ldap auth

I recently wrote about how I wrote a docker container for newspipe. Now, I have added ldap authentication and it has been accepted by upstream!

Now you can add a bunch of config options to your configuration .py file:

# Ldap, optional
LDAP_ENABLED = False
# LDAP_URI will automatically try the _ldap._tcp lookups like for a
# kerberos domain but
# will fall back to this exact domain (server) name if such a TXT
# record is not found.
LDAP_URI = "ldaps://ipa.internal.com:636"
LDAP_USER_BASE = "cn=users,cn=accounts,dc=ipa,dc=internal,dc=com"
LDAP_GROUP_BASE = "cn=groups,cn=accounts,dc=ipa,dc=internal,dc=com"
LDAP_USER_MATCH_ATTRIB = "uid"
LDAP_USER_DISPLAY_ATTRIB = "uid"
LDAP_USER_ATTRIB_MEMBEROF = "memberof"
LDAP_GROUP_DISPLAY_ATTRIB = "cn"
LDAP_BIND_DN = "uid=sampleuser,cn=users,cn=accounts,dc=ipa,dc=internal,dc=com"
LDAP_BIND_PASSWORD = "examplepassword"
# Additional filter to restrict user lookup. If not equivalent to
# False (e.g., undefined), will be logical-anded to the
# user-match-attribute search filter.
LDAP_FILTER = "(memberOf=cn=newspipe-users,cn=groups,cn=accounts,dc=ipa,dc=internal,dc=com)"

I wrote my ldap logic back for a sample project 2 years ago.

I haven't yet tried adding kerberos authentication. I was too lazy to fetch a kerberos ticket for HTTP/examplserver.ipa.example.com and deal with that. It should be possible to implement that however, for a motivated individual.

Comments