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
  • g5pw@feddit.it
    link
    fedilink
    English
    arrow-up
    14
    ·
    edit-2
    2 years 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.

    • sudneo@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      1
      ·
      2 years ago

      Thanks (grazie?)! I was looking for something similar and kanidm looks great feature wise and simple to deploy!

    • timbuck2themoon@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      2 years 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
        1
        ·
        2 years 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
          2
          ·
          2 years 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
            ·
            2 years 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
              ·
              2 years 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.

                • timbuck2themoon@sh.itjust.works
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  edit-2
                  2 years ago
                  0e2475ba-882a-4f61-8938-2642ca80193b WARN     │  ┝━ 🚧 [warn]: WARNING: index "displayname" Equality was not found. YOU MUST REINDEX YOUR DATABASE
                  0e2475ba-882a-4f61-8938-2642ca80193b WARN     │  ┝━ 🚧 [warn]: WARNING: index "name_history" Equality was not found. YOU MUST REINDEX YOUR DATABASE
                  0e2475ba-882a-4f61-8938-2642ca80193b WARN     │  ┝━ 🚧 [warn]: WARNING: index "jws_es256_private_key" Equality was not found. YOU MUST REINDEX YOUR DATABASE
                  

                  I had to drop it for a few days. I got that at some point though. It’s all brand new so I wouldn’t know why. Seems a bit rough around the edges so far. I’ll try to reindex and attempt again. I really want this to be the product I use since it’s a nice AIO solution but we’ll see.

                  Edit:

                  [~]$ podman run --rm -i -t -v kanidm:/data \
                      kanidm/server:latest /sbin/kanidmd reindex -c /data/server.toml
                  error: unrecognized subcommand 'reindex'
                  

                  Phew boy. Straight from the docs. Same with the vacuum command.

                  Looks like the docs need updated to specify the command is kanidm database reindex -c /data/server.toml

                  And further upon trying to login…

                  300e55b7-e30a-42a5-ac3e-ec0e69285605 INFO     handle_request [ 188µs | 0.00% / 100.00% ]
                  300e55b7-e30a-42a5-ac3e-ec0e69285605 INFO     ┕━ request [ 188µs | 72.94% / 100.00% ] method: GET | uri: /v1/auth/valid | version: HTTP/1.1
                  300e55b7-e30a-42a5-ac3e-ec0e69285605 INFO        ┝━ handle_auth_valid [ 50.8µs | 25.54% / 27.06% ]
                  300e55b7-e30a-42a5-ac3e-ec0e69285605 INFO          ┝━ validate_client_auth_info_to_ident [ 2.85µs | 1.51% ]
                  300e55b7-e30a-42a5-ac3e-ec0e69285605 WARN            ┕━ 🚧 [warn]: No client certificate or bearer tokens were supplied
                  300e55b7-e30a-42a5-ac3e-ec0e69285605 ERROR         ┕━ 🚨 [error]: Invalid identity: NotAuthenticated | event_tag_id: 1
                  300e55b7-e30a-42a5-ac3e-ec0e69285605 WARN        ┕━ 🚧 [warn]:  | latency: 204.504µs | status_code: 401 | kopid: "300e55b7-e30a-42a5-ac3e-ec0e69285605" | msg: "client error"
                  

                  I think I’m gonna have to just nuke it and start fresh but yeah, this is not a great first impression at all.

    • JustEnoughDucks@feddit.nl
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 years ago

      OIDC does indeed work fine too.

      I use it on nextcloud and immich and a few others.

      You will be much more hard pressed to find apps that support SSO and oidc than oidc that authelia is broken on.

    • johntash@eviltoast.orgOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 years ago

      Hmm I thought authelia could only act as an oidc provider, I didn’t think it could allow logging in through a Google account for example?

      I’ll take a look at the docs again, thanks!

      • Unchanged3656@infosec.pub
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 years ago

        After looking deeper into the docs they do not support and do not plan to support the Relying Party role. So it probably won’t fit for this use case.

        • johntash@eviltoast.orgOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          2 years ago

          Thanks for confirming, I just saw that as well.

          I’m going to try some of the other solutions in this thread, but I might still come back to authelia and just ignore my requirement for having social login. I like the idea of sending someone a link and saying “Hey just log in with your google account” instead of having to create an actual user for them, but maybe I can use something else specifically for those cases.

  • Lem453@lemmy.ca
    link
    fedilink
    English
    arrow-up
    7
    ·
    edit-2
    2 years 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
      1
      ·
      2 years 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?

  • PlexSheep@feddit.de
    link
    fedilink
    English
    arrow-up
    7
    ·
    2 years ago

    I use authentik. The login flow is a little weird I agree, my password manager doesn’t like it too. Besides that, from the ones I used it’s definitely the most stable and developed (I was using authelia before).

    I can’t quite figure out how to use it with proxy auth.

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

  • krash@lemmy.ml
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    edit-2
    2 years ago

    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.

    • johntash@eviltoast.orgOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 years ago

      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.

    • atzanteol@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 years ago

      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.

    • Nibodhika@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 years ago

      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.

    • johntash@eviltoast.orgOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 years 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.

  • lckdscl [they/them]@whiskers.bim.boats
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 years ago

    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.

    • faercol@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 years 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

  • notfromhere@lemmy.ml
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 years ago
    • 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
  • synae[he/him]@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 years ago

    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.

  • Decronym@lemmy.decronym.xyzB
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year 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 18 acronyms.

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