this post was submitted on 16 Mar 2024
97 points (100.0% liked)

Selfhosted

45508 readers
757 users here now

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!

founded 2 years ago
MODERATORS
 

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
top 50 comments
sorted by: hot top controversial new old
[–] redcalcium@lemmy.institute 20 points 1 year ago (6 children)

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://" (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.

load more comments (6 replies)
[–] g5pw@feddit.it 14 points 1 year ago* (last edited 1 year ago) (3 children)

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 4 points 1 year ago

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

[–] johntash@eviltoast.org 2 points 1 year ago

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

[–] timbuck2themoon@sh.itjust.works 2 points 1 year ago* (last edited 1 year ago) (8 children)

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.

load more comments (8 replies)
[–] PlexSheep@feddit.de 8 points 1 year 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.

[–] Unchanged3656@infosec.pub 8 points 1 year ago (4 children)

Depending on what you are trying to do, Authelia does have OIDC in beta https://www.authelia.com/roadmap/active/openid-connect/

I use Authelia again since in beta it now supports multiple Pass/FIDO keys via the web interface, and it does work reasonably well.

[–] JustEnoughDucks@feddit.nl 3 points 1 year 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.

load more comments (3 replies)
[–] Lem453@lemmy.ca 7 points 1 year ago* (last edited 1 year ago) (7 children)

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.

load more comments (7 replies)
[–] exu@feditown.com 7 points 1 year ago

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 5 points 1 year ago (1 children)

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

[–] toff@feddit.de 2 points 1 year 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 5 points 1 year ago* (last edited 1 year ago) (5 children)

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.org 3 points 1 year 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 2 points 1 year 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.

[–] redcalcium@lemmy.institute 2 points 1 year ago* (last edited 1 year ago)

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.

load more comments (1 replies)
[–] callmemagnus@lemmy.world 4 points 1 year ago (1 children)

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

[–] johntash@eviltoast.org 3 points 1 year 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.

[–] thefactremains@lemmy.world 4 points 1 year ago (2 children)
[–] TCB13@lemmy.world 4 points 1 year ago (1 children)

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

[–] TCB13@lemmy.world 3 points 1 year ago

* just love the random downvote ahaha

[–] johntash@eviltoast.org 2 points 1 year ago

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

[–] poVoq@slrpnk.net 3 points 1 year ago (1 children)

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.

load more comments (1 replies)
[–] notfromhere@lemmy.ml 3 points 1 year ago (1 children)
  • 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 2 points 1 year ago (1 children)

Did you move to Keycloak, or something else?

[–] notfromhere@lemmy.ml 5 points 1 year ago

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.

[–] Moonrise2473@feddit.it 3 points 1 year ago (1 children)

unpopular closed source option: cloudflare access after a cloudflare tunnel

[–] johntash@eviltoast.org 2 points 1 year 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.

[–] Netrunner@programming.dev 3 points 1 year ago (1 children)

Authelia does support oidc and its amazing.

[–] faercol@lemmy.blahaj.zone 2 points 1 year 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

[–] lckdscl@whiskers.bim.boats 3 points 1 year 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.

[–] wuphysics87@lemmy.ml 2 points 1 year ago (2 children)
load more comments (2 replies)
[–] Decronym@lemmy.decronym.xyz 2 points 1 year ago* (last edited 6 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 18 acronyms.

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

load more comments