Jellyfin, Authentik, DUO. 2FA solution tutorial. - Printable Version +- Jellyfin Forum (https://forum.jellyfin.org) +-- Forum: Support (https://forum.jellyfin.org/f-support) +--- Forum: Guides, Walkthroughs & Tutorials (https://forum.jellyfin.org/f-guides-walkthroughs-tutorials) +--- Thread: Jellyfin, Authentik, DUO. 2FA solution tutorial. (/t-jellyfin-authentik-duo-2fa-solution-tutorial) Pages:
1
2
|
Jellyfin, Authentik, DUO. 2FA solution tutorial. - HazzaFTW28 - 2023-08-20 reddit version: https://www.reddit.com/r/selfhosted/comments/15wfmaz/jellyfin_authentik_duo_2fa_solution_tutorial/ This tutorial/ method is 100% compatible with all clients. Has no redirects. when logging into jellyfin via through any client, etc. TV, Phone, Firestick and more, you will get a notification on your phone asking you to allow or deny the login. for people who want more of an understanding of what it does, here's a video: https://imgur.com/a/1PesP1D The following tutorial will done using a Debain/Ubuntu system but you can switch out commands as you need. This quite a long and extensive tutorial but dont be intimidated as once you get going its not that hard. credits to: LDAP setup: https://www.youtube.com/watch?v=RtPKMMKRT_E DUO setup: https://www.youtube.com/watch?v=whSBD8YbVlc&t Prerequisites:
when first creating an account, it will give you a free trial for a month which gives you the ability to add more than 10 users but after that you will be limited to 10. Install Authentik.
sudo apt install docker docker.io docker-compose
sudo groupadd docker sudo usermod -aG docker $USER logout and back in to take effect
sudo apt-get install -y pwgen
sudo apt install wget
sudo mkdir /opt/authentik sudo chown -R $USER:$USER /opt/authentik/ cd /opt/authentik/
wget https://goauthentik.io/docker-compose.yml echo "PG_PASS=$(pwgen -s 40 1)" >> .env echo "AUTHENTIK_SECRET_KEY=$(pwgen -s 50 1)" >> .env docker-compose pull docker-compose up -d Your server shoudl now be running, if you haven't mad any changes you can visit authentik at: http://<your server's IP or hostname>:9000/if/flow/initial-setup/
configure Authentik publicly. At this step i would recommend you have your authentik server pointed at your public dns server. (cloudflare). if you would like a tutorial to simlulate having a static public ip with ddns & cloudflare message me.
configure LDAP:
allow LDAP to be queried
Jellyfin users jellyfin admins must be assigned to the user and admin group. normal user just assign to jellydin users
setup jellyfin for LDAP
LDAP bind LDAP Server: the authentik servers local ip LDAP Port: 389 LDAP Bind User: cn=service,ou=service,dc=ldap,dc=goauthentik,dc=io LDAP Bind User Password: (the service account password you create earlier) LDAP Base DN for searches: dc=ldap,dc=goauthentik,dc=io click save and test LDAP settings LDAP Search Filter: (&(objectClass=user)(memberOf=cn=Jellyfin Users,ou=groups,dc=ldap,dc=goauthentik,dc=io)) LDAP Search Attributes: uid, cn, mail, displayName LDAP Username Attribute: name LDAP Password Attribute: userPassword LDAP Admin Filter: (&(objectClass=user)(memberOf=cn=Jellyfin Admins,ou=groups,dc=ldap,dc=goauthentik,dc=io))
bind DUO to LDAP
now whenever you create a new user, create it in authentik and add the user the jellyfin users group and optionally the jellyfin admins group. then create that user in duo admin. once created get the users code from the url and assign it to the user in duo stage, import device option. i hope this helps someone and do not hesitate to ask for help. RE: Jellyfin, Authentik, DUO. 2FA solution tutorial. - Jellyfenmo - 2023-09-29 Thanks for taking the time to write this up! I was struggling with how to properly populate the LDAP Search Filter & this made it super easy. RE: Jellyfin, Authentik, DUO. 2FA solution tutorial. - ballen - 2023-10-11 Thanks for the writeup @HazzaFTW28, now that I'm about to make the switch from Plex to Jellyfin, I'm very excited to use this method this evening RE: Jellyfin, Authentik, DUO. 2FA solution tutorial. - محمد أشرف - 2024-01-09 First of all, thanks a lot @HazzaFTW28 for preparing tutorial and my question is can we configure user limit for certain time frame? Like 6 month user access. I'm now looking suitable hardware and plan to build one soon.. RE: Jellyfin, Authentik, DUO. 2FA solution tutorial. - Autchirion - 2024-01-28 (2023-09-29, 06:21 AM)Jellyfenmo Wrote: Thanks for taking the time to write this up! I was struggling with how to properly populate the LDAP Search Filter & this made it super easy. Did you manage to get it running? Because for me it returns "Connect (Success); Bind (Success); Base Search (Found 0 Entities)" after clicking "Save and Test LDAP Server Settings". Also if I continue the process, it doesn't return any user/admin, any ideas? I followed the tutorial and did basically everything twice to make sure I didn't make a mistake in the first run. RE: Jellyfin, Authentik, DUO. 2FA solution tutorial. - likwid101 - 2024-02-19 I had to change " in duo on the left click application > protect an application find duo api > click protect " to " LDAP Proxy " as the Duo API is only for paying folks and I'm on the free version... but all else was left the same and it worked. Thanks so much for the write up! RE: Jellyfin, Authentik, DUO. 2FA solution tutorial. - 1simpleAtom - 2024-10-08 While I am able to successfully connect Jellyfin to the LDAP server: Code: Connect (Success); Bind (Success); Base Search (Found 7 Entities) I seem to be unable to find any users or admins: Code: Found 0 user(s), 0 admin(s) I have gone over the LDAP search filter many times, but can't seem to find an error. Attached is a screenshot of my Jellyfin LDAP setup, should someone like to take a look. edit: Looking back through things, I noticed when I created the LDAP application provider and bound it to ldap-authentication-flow I was unable to assign a search group. The problem is, there is no option for me to do so. solution: The problem did in fact have to do with not having been able to assign the service account to the ldap-authentication-flow search group. On version 2024.8.3 of Authentik, this is now done after creating the LDAP application provider and going to the permissions tab and then Assign to a new user. RE: Jellyfin, Authentik, DUO. 2FA solution tutorial. - BourbonDoc - 2024-10-11 I know it's a bit like a needle in a haystack, but I've followed everything up through configuring LDAP in Jellyfin, but when I save and test it says "Connect: Connect error". I tried restarting Jellyfin to no avail. Any ideas?
[2024-10-11 13:45:16.515 -04:00] [WRN] [31] Jellyfin.Plugin.LDAP_Auth.LdapAuthenticationProviderPlugin: Ldap Test Failed to Connect or Bind to server 1 startingTimestamp)at System.Net.Dns.<>c.<GetHostEntryOrAddressesCoreAsync>b__33_0(Object s, Int64 startingTimestamp) at System.Net.Dns.<>c__DisplayClass39_0 1.<RunAsync>b__0(Task <p0>, Object <p1>) 1.InnerInvoke()at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Novell.Directory.Ldap.Connection.Connect(String host, Int32 port, Int32 semaphoreId) `
RE: Jellyfin, Authentik, DUO. 2FA solution tutorial. - TheDreadPirate - 2024-10-11 The host firewall doesn't allow connections on that port? RE: Jellyfin, Authentik, DUO. 2FA solution tutorial. - BourbonDoc - 2024-10-11 Good thought! Unfortunately didn't work. I tried 389 as well as the webUI port for the port, as well as trying the domain name for the server address. I suspect I've got some sort of issue with what I'm putting as the IP. LDAP Outpost is my verified domain, auth.x.x LDAP server in Jellyfin is server IP Port I've tried 389 and my webUI port I can see a container running the LDAP with 389 published. I tried the container IP address as well and that didn't work. |