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
    • Chrissss Toff@feddit.de
      link
      fedilink
      English
      arrow-up
      2
      ·
      7 months ago

      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.

  • g5pw@feddit.it
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    7 months ago

    I use kanidm with oauth2-proxy. No issues so far, it was pretty easy to set up.

    Note that the connection to kanidm needs to be TLS even if you have a reverse proxy!

    EDIT: currently using 80MB RAM for two users and three Service Providers.

    • timbuck2themoon@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      7 months ago

      Does this do it all? It seems that it holds all your users like LDAP and can auth that way too. But it can also do simple oidc integrations too? Basically just want to see if it is the all in one. Looks like it does which is why i wonder why you use oauth2-proxy in addition.

      I’ve otherwise been trailing keycloak/authelia as the oidc portion and lldap/freeipa as the ldap Backend that actually holds the users. Would love to simplify if possible.

      • g5pw@feddit.it
        link
        fedilink
        English
        arrow-up
        0
        ·
        7 months ago

        Yes, it should cover all the use cases you mention!

        I use oauth2-proxy as ForwardAuth on Traefik so I can protect apps that do not support OAuth/OIDC login/

        • timbuck2themoon@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          1
          ·
          7 months ago

          Awesome. Thank you.

          Now to see how i make this work in k8s since they evidently mandate the cert inside instead of just allowing the ingress to have it.

          • g5pw@feddit.it
            link
            fedilink
            English
            arrow-up
            1
            ·
            7 months ago

            Yeah, sounds like a security feature… I was able to configure Traefik to connect with TLS, verifying the peer certificate.

            • timbuck2themoon@sh.itjust.works
              link
              fedilink
              English
              arrow-up
              1
              ·
              7 months ago

              I could do this but sadly even just the trial did not work. I’m using podman but it gives me “invalid state” just trying to login with a user per the quickstart, etc. Can’t reset the password cleanly, can’t add a passkey via bitwarden, etc.

              Unsure if I’m doing something wrong or if it’s very alpha/beta.

  • Lem453@lemmy.ca
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    7 months ago

    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@eviltoast.orgOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      7 months ago

      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?

      • node815@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        7 months ago

        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.

  • redcalcium@lemmy.institute
    link
    fedilink
    English
    arrow-up
    3
    ·
    7 months ago

    Keycloak seems complicated, but it’s actually not that complicated if you use it for simple OIDC provider.

    Just create a new realm, then go to client -> create. Enter your client-id, with openid-connect as protocol. Then, set access type to “confidential”, set valid redirect uri to “https://<your app>” (or even “https://*” if you’re lazy and want to use it on multiple apps). Then hit save and go to the credential tab to copy your client secret. Then head to “users” menu to start adding users to your realm.

    That’s the basic setup which should be good for home use. The good thing about keycloak is, as you grow your homelab, whatever stuff you may need later can be provided by keycloak. Want some users to have access to app A, but not app B? 2 factor auth? Allow users to login with google account? Heck, allow users to login with another sso provider (chaining)? You can do pretty much anything.

    • johntash@eviltoast.orgOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      7 months ago

      That doesn’t sound too bad, thanks for the instructions. I’ll probably give keycloak another try too.

      Do you know what kind of cpu memory usage it has? I saw the newer versions are supposed to be lighter, but haven’t tested it yet.

      • keyez@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        7 months ago

        I’ve had one realm with 5 clients and nothing crazy setup running for about 3 years across 3 major versions and haven’t had many problems

      • redcalcium@lemmy.institute
        link
        fedilink
        English
        arrow-up
        1
        ·
        7 months ago

        Currently it’s using ~511MB of memory, which is comparable to typical web apps. CPU usage is almost zero because it’s idle most of the time (you’re practically only using it on login only).

        I’m still on keycloak v19 and haven’t had a change to upgrade to the latest version yet and have no idea how much memory the latest version will use, but I remember testing keycloak before they migrated to quarkus and it was sitting at ~2GB memory and was immediately turned off by it. I gave it a try again after I heard the memory usage got better and stick around since then.

  • Decronym@lemmy.decronym.xyzB
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    7 months ago

    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 5 acronyms.

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

    • johntash@eviltoast.orgOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 months ago

      cloudflare access + cloudflare tunnels is a cool solution, and was easy to set up in the past, but I’d rather stick to something completely self-hosted. I’d probably use it for something completely public, but not things that route into my homelab.

  • bitwolf@lemmy.one
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    7 months ago

    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.

    • johntash@eviltoast.orgOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 months ago

      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.

    • faercol@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 months ago

      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