Welcome to Incremental Social! Learn more about this project here!
Check out lemmyverse to find more communities to join from here!

Simple authentication for homelab?

What's everyones recommendations for a self-hosted authentication system?

My requirements are basically something lightweight that can handle logins for both regular users and google. I only have 4-5 total users.

So far, I've looked at and tested:

  • Authentik - Seems okay, but also really slow for some reason. I'm also not a fan of the username on one page, password on the next screen flow
  • Keycloak - Looks like it might be lighter in resources these days, but definitely complicated to use
  • LLDAP - I'd be happy to use it for the ldap backend, but it doesn't solve the whole problem
  • Authelia - No web ui, which is fine, but also doesn't support social logins as far as I can tell. I think it would be my choice if it did support oidc
  • Zitadel - Sounds promising, but I spent a couple hours troubleshooting it just to get it working. I might go back to it, but I've had the most trouble with it so far and can't even compare the actual config yet
bitwolf ,

Been happy with Zitadel so far.

I usually worry about getting bit later with apps that depend on a relational database.

This is my first cockroach db app and it's not nearly as obtuse as the MySQL container image. Hopefully it continues to work smoothly.

Dehydrated ,

I've been using Authelia for almost 2 years and I really like it. Never had any issues.

toff ,
@toff@feddit.de avatar

The latest update to authelia 4.38 was a little bit cumbersome, because you hat to manually adjust the configuration. But all in all I like authelia, too.

callmemagnus ,

Why not keep everything in your LAN and setup a wire guard bastion ?

johntash OP ,

That's essentially what I am doing. Everything is on the LAN by default. I have two instances of Traefik. One that runs only on internal VPN ips, and another on remote servers using public ips. So I can choose which services are accessible over lan/vpn or public (routed through a vpn to lan).

That doesn't solve the authentication problem if I want to expose something to the internet though, or even sso inside the lan.

synae ,
@synae@lemmy.sdf.org avatar

I use oauth2proxy+nginx ingress gateway where needed (apps that don't support OIDC themselves), with dex their OIDC provider, and github is dex's upstream IDP+OIDC.

Lem453 ,

Authentik works very well and has the most flexibility if you have the resources to run it (not an rpi)

You can change the logon flow to make the username and password on the same page

Another user mention issues with password managers auto filling. There is a comparability button as well on the login flow that allows bitwarden and other to auto fill correctly.

Authentik has LDAP built in along with every SSO method that exists. Makes it super nice to integrate into as many services as possible.

I use it with oAuth, LDAP and reverse proxy authentication.

johntash OP ,

You can change the logon flow to make the username and password on the same page
There is a comparability button as well on the login flow that allows bitwarden and other to auto fill correctly.

Thanks for the tips, I found the compatibility button and will try it out. I'm not sure I see how to change the username/password to be on the same page though. Do you have to create a whole new login flow?

Lem453 ,

I think I saw a tutorial on YouTube for how to do it but this page describes it as well. I edited the default login flow to include the password box

https://docs.goauthentik.io/docs/flow/stages/identification/

johntash OP ,

Thanks! I managed to get user/pass on the same page and it works great with the compatibility mode

node815 ,
@node815@lemmy.world avatar

https://www.youtube.com/@cooptonian
His Authentik videos are top notch and they (Authentik) have also had him make some for them. One of those videos, I can't recall shows you how to do this, I think it may be the 2FA/MFA one. I use Authentik and can login with fingerprint login without using my UN/PW first. It's pretty slick.

johntash OP ,

Thanks for the recommendation, I'll take a look at some of his videos. I managed to get the un/pw on one page, but haven't done much with webauthn/passwordless stuff yet so that might be useful too.

bmcgonag ,

This. 100%

Netrunner ,
@Netrunner@programming.dev avatar

Authelia does support oidc and its amazing.

faercol ,
@faercol@lemmy.blahaj.zone avatar

Authelia is a oidc provider, but does not support oidc as a provider, only local file and ldap. So it really depends on your use case

notfromhere ,
  • Authentik is pretty resource intensive. Needs something like 3 servers/instances. A database, a server and a worker. Uses something like 800+ MB ram just for this service. Since I run my services on raspberry Pi 3s, I ended up moving away from this
  • Keycloak works great but is a bit difficult to set up and doesn’t support all the authentication protocols that Authentik does
johntash OP ,

Did you move to Keycloak, or something else?

notfromhere ,

Honestly I just moved back to local accounts. I’m interested in the other comments on this post for a good solution to move to.

ad_on_is ,
@ad_on_is@lemmy.world avatar

Authelia + LLDAP

chiisana ,
@chiisana@lemmy.chiisana.net avatar

OIDC was a huge thing for me, I used FusionAuth for a bit and it worked great. Then I learned I could deploy my own WebAuthn / passkey password-less authentication, moved over to Authentik, and never looked back.

johntash OP ,

Do you have any issues with Authentik being slow? It might be my environment since I haven't done much troubleshooting yet.

chiisana ,
@chiisana@lemmy.chiisana.net avatar

Do you mind elaborating a little on in what sense it is slow for you? It doesn’t “feel” slow for me, but as you’ve identified, it’s a multipage login process with some JavaScript driven content, so it’s not exactly the fastest compared to something more static. The pages generally loads in around/under 1 second for me; and once authenticated, the flow happens fairly quickly and infrequently that I don’t really notice or care for it.

johntash OP ,

Once I'm authenticated, it's actually pretty okay. It goes through the redirections fast enough that I wouldn't notice usually. But the login pages would take several seconds to load for me, and navigating around the admin ui also seemed to take several seconds for each page change.
So not extremely slow, but slow enough to notice and get annoyed by it. Admittedly I probably could increase the session duration or something to help with that too.

chiisana ,
@chiisana@lemmy.chiisana.net avatar

Admin UI feels okay to me, at most 1/2 a second between page loads/repaints, definitely not several seconds kind of slow. I am running it on my oracle free tier VM and I’ve got only 3 users, so maybe I’m way over provisioned? Have you tried to measure where the latency is coming from? As in, it is the raw page load that’s slow, or if it is subsequent JavaScript triggered requests bottlenecking the performance?

Decronym Bot , (edited )

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
HTTP Hypertext Transfer Protocol, the Web
SSL Secure Sockets Layer, for transparent encryption
SSO Single Sign-On
TLS Transport Layer Security, supersedes SSL
VPN Virtual Private Network
k8s Kubernetes container management package
nginx Popular HTTP server

6 acronyms in this thread; the most compressed thread commented on today has 11 acronyms.

[Thread for this sub, first seen 16th Mar 2024, 12:15]
[FAQ] [Full list] [Contact] [Source code]

krash ,

Sorry for the off topic question, but what are the gains / constraints of using an identity / authentication service? Sure, you only are going to need to remember one password/identity. But each webapp must have support for the said protocol, and so does their clients, no? It does seem like a lot of work (and risk exposure) for little gain.

Please enlighten me if I'm missing something.

atzanteol ,

Making it easier for users to remember passwords leads to them using better passwords and practicing better password hygiene generally.

You can also change your password across multiple systems easily if your password is compromised.

johntash OP ,

As long as it's a web app, it's usually fine and can provide an extra layer of security. The app does need to have some support for sso if you want it to be seamless though, without logging in twice.

Most of my services are internal only, but sometimes I want to give access to someone on the internet without also giving them VPN access. If the app doesn't support any kind of login, having an Auth proxy in front of it really helps for that use case.

Remembering lots of passwords isn't a big deal if you have a password manager, but not having to log in to each app separately is nice. It's also nice to be able to put Auth in front of things that don't support it natively.

chiisana ,
@chiisana@lemmy.chiisana.net avatar

Most of the apps I use support external authentication using popular standards (OAuth for most part). This means the clients will also support the said standards out of the box. Having a standardized authentication flow makes logging in much easier as well.

I also don’t want to deal with passwords… because I don’t trust myself to handle passwords. So before settling down on Authentik, I used FusionAuth to do OIDC via Google. Then I discovered I could do WebAuthn / Passkey with Authentik, so the portal really only ever need to know my public key, and approves access based on private keys, which are gated by my devices’ biometric features. This is way more secure than other solutions and I don’t even need to remember a password.

The one edge case I’ve encountered is a couple of apps recently transitioning to mandating authentication, but doesn’t have OIDC integration of their own. Fortunately, there’s a hidden config flag in XML that I can use to tell them that I have externally managed authentication, and I gate access to them via a middleware in my reverse proxy. As for client, my client of choice allows me to add custom HTTP headers, so I have a special “API key” kind of header that my reverse proxy looks at, which allow me to bypass authentication, so everything works nicely together.

In my mind, using the vanilla out of the box authentication feels less secure than me gating things via OIDC or middleware. This is because everyone knows they could Google for “Powered by WordPress” or similar phrase to target specific apps with known authentication exploit. However, by switching it up and using a different mechanism, the common exploit vectors might not be as effective against my deployment.

Nibodhika ,

Login is a dangerous and difficult thing to implement, are you sure that all of your services:

  • Store passwords hashed and salted
  • Have brute-force prevention
  • Etc

It's safer to have one service focused on that and other services can rely on that one to implement it correctly.

redcalcium ,

Mostly for convenience and standardizing your security procedure. Most apps popular for self hosting now supports OIDC, so it's no brainer to setup. On the other hand, most apps don't support 2fa, or support it in a weird way (e.g. no recovery code). By using an identity service, you can be sure all your apps follow the same login standard you setup.

For those apps that don't support OIDC, you can simply slap oauth2proxy in front of it and it's done.

exu ,
@exu@feditown.com avatar

I'm pretty happy with Authentik. Bitwarden at least has no issues with auto-filling the username and password fields when I want to log in.

It is also a very complete solution offering basically any current authentication protocol and integration with other providers.

poVoq ,
@poVoq@slrpnk.net avatar

I have been looking into this: https://gitlab.com/yaal/canaille to extend my LLDAP, but it can also work without an LDAP backend if you only need OIDC.

johntash OP ,

Canaille looks pretty interesting and simple too, thanks for the link!

lckdscl ,
@lckdscl@whiskers.bim.boats avatar

I've been using Authelia with several OIDC integrations for a while now. Works great. They've released a huge update like a day ago too. Out of the ones you listed, it's very lightweight too. The docs are a bit all over the place but it is quite comprehensive.

I did look at Zitadel and tried setting it up myself but I just couldn't get it to work. The docs are a bit vague.

wuphysics87 ,

Padlock

johntash OP ,

Do you have a link for padlock by any chance?

I'm not sure if this is it, but I found a password manager named padloc: https://github.com/padloc/padloc

wuphysics87 ,

It was a bad joke because you said you needed something for your homelab

  • All
  • Subscribed
  • Moderated
  • Favorites
  • selfhosted@lemmy.world
  • incremental_games
  • meta
  • All magazines