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
adONis
link
fedilink
English
18M

Authelia + LLDAP

@Moonrise2473@feddit.it
link
fedilink
English
18M

unpopular closed source option: cloudflare access after a cloudflare tunnel

@johntash@eviltoast.org
creator
link
fedilink
English
28M

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.

@Decronym@lemmy.decronym.xyz
bot account
link
fedilink
English
2
edit-2
2M

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]

conrad82
link
fedilink
English
12M

I use nforwardauth . It is simple, but only supports username/password

https://github.com/nosduco/nforwardauth

check out vouch proxy.

@TCB13@lemmy.world
link
fedilink
English
38M

I was going to suggest Nginx with phpAuthRequest but your solution seems more inline with what the OP is asking for.

@TCB13@lemmy.world
link
fedilink
English
18M

* just love the random downvote ahaha

@johntash@eviltoast.org
creator
link
fedilink
English
28M

Thanks, I’ll take a look! It might be helpful even if I use a different idp

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.

@notfromhere@lemmy.ml
link
fedilink
English
18M

Does that work with gitea? I was able to get it working with Authentik but wasn’t able to get it working on Keycloak.

Yep. I’ve got a test instance working with keycloak. Post up the problem you’re having and i can check it against mine. I think all of it was configured via UI on both except there are two changes in the gitea config.INI that allowed that auth and auto created users if they didn’t exist yet.

If you have some error message, it would be easier to identify the issue. Typical problems:

  • incorrect redirect url
  • incorrect endpoints on gitea. I haven’t used gitea yet, but keycloak changes their openid configuration endpoint from [your host]/realms/[your realm]/.well-known/openid-configuration/ to [your host]/auth/realms/[your realm]/.well-known/openid-configuration/, and some apps still use the old one. You might be able to correct this by manually entering keycloak endpoint in your oidc settings.
@johntash@eviltoast.org
creator
link
fedilink
English
18M

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
28M

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

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.

@PlexSheep@feddit.de
link
fedilink
English
98M

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.

@g5pw@feddit.it
link
fedilink
English
15
edit-2
8M

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
28M

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
2
edit-2
8M

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
18M

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/

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
18M

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

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.

@g5pw@feddit.it
link
fedilink
English
18M

I didn’t have any issues, do you see anything in the logs?

@timbuck2themoon@sh.itjust.works
link
fedilink
English
1
edit-2
8M
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.

@johntash@eviltoast.org
creator
link
fedilink
English
28M

Thanks, kanidm looks promising. I’ll try it out this weekend

bitwolf
link
fedilink
English
08M

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.

@notfromhere@lemmy.ml
link
fedilink
English
38M
  • 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@eviltoast.org
creator
link
fedilink
English
28M

Did you move to Keycloak, or something else?

@notfromhere@lemmy.ml
link
fedilink
English
58M

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.

lckdscl [they/them]
link
fedilink
English
38M

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.

poVoq
link
fedilink
English
38M

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@eviltoast.org
creator
link
fedilink
English
18M

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

exu
link
fedilink
English
78M

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.

@Dehydrated@lemmy.world
link
fedilink
English
58M

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

Chrissss Toff
link
fedilink
English
28M

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.

Authelia does support oidc and its amazing.

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

Create a post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

  • 1 user online
  • 191 users / day
  • 419 users / week
  • 1.14K users / month
  • 3.85K users / 6 months
  • 1 subscriber
  • 3.71K Posts
  • 74.6K Comments
  • Modlog