this post was submitted on 18 Mar 2025
84 points (96.7% liked)

Selfhosted

45389 readers
505 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 are you folks using for self-hosted single sign-on?

I have my little LDAP server (lldap is fan-fucking-tastic -- far easier to work with than OpenLDAP, which gave me nothing but heartburn). Some applications can be configured to work with it directly; several don't have LDAP account support. And, ultimately, it'd be nice to have SSO - having the same password everywhere if great, but having to sign in only once (per day or week, or whatever) would be even nicer.

There are several self-hosted Auth* projects; which is the simplest and easiest? I'd really just like a basic start-it-up, point it at my LDAP server, and go. Fine grained ACLs and RBAC support is nice and all, but simplicity is trump in my case. Configuring these systems is, IME, a complex process, with no small numbers of dials to turn.

A half dozen users, and probably only two groups: admin, and everyone else. I don't need fancy. OSS, of course. Is there any of these projects that fit that bill? It would seem to be a common use case for self-hosters, who don't need all the bells and whistles of enterprise-grade solutions.

top 50 comments
sorted by: hot top controversial new old
[–] sk@hub.utsukta.org 34 points 2 weeks ago (2 children)

Authentik! i've been using it since over a year and its been a wonderful experience. supports many protocols and is updated regularly, as a beginner i didnt have difficulty setting it up, has decent documentation for integrations.

[–] sxan@midwest.social 3 points 2 weeks ago (1 children)

That's the one I keep seeing and thinking, maybe I should try it. Thanks for the input!

[–] johntash@eviltoast.org 2 points 2 weeks ago

I'd also recommend Authentik. It's simpler than something like keycloak imo and works pretty well. They also have guides for quite a few self hosted services.

I did have issues with it being slow at some point, but an update fixed it iirc.

[–] Flipper@feddit.org 1 points 2 weeks ago

I don't like the interface for setting up flows. Feels needlessly complicated.

[–] roofuskit@lemmy.world 23 points 2 weeks ago (3 children)

Just copied and pasted my comment from another recent post about Authelia.

After recently trying Authelia I gave up and moved to Authentik. Very much appreciate the all in one functionality of it. The company even paid a YouTuber to make a bunch of useful step by step tutorials and they have been invaluable. They also have a number of SSO integration instructions for various software. I highly recommend giving it a try if you're in the market for an easy enough self hosted SSO and proxy password system.

[–] sxan@midwest.social 8 points 2 weeks ago (1 children)

Thanks! Two for Authentik.

[–] roofuskit@lemmy.world 8 points 2 weeks ago

I think it really shines because it supports everything. LDAP, SAML, OAUTH2, OpenID, everything. There are options for TOTP, Duo, Webauth, etc... and you can enforce MFA if you like. The only apps I have been unable to integrate are ones that offer no SSO integration at all.

[–] clmbmb@lemmy.dbzer0.com 2 points 2 weeks ago (1 children)

paid a YouTuber

a link to his/her channel would be great.

[–] roofuskit@lemmy.world 2 points 2 weeks ago (1 children)
[–] clmbmb@lemmy.dbzer0.com 2 points 2 weeks ago (1 children)
[–] roofuskit@lemmy.world 2 points 2 weeks ago

No problem. Thanks for the reminder that just because he's the first thing I see when I search Authentik on YouTube doesn't mean that's what you get.

[–] slazer2au@lemmy.world 1 points 2 weeks ago (1 children)

Are you taking about Jim's Garage?

[–] roofuskit@lemmy.world 2 points 2 weeks ago* (last edited 2 weeks ago)
[–] node815@lemmy.world 11 points 2 weeks ago (4 children)

Pocket id is my go to. I used to use Authentik, but it was overkill for us. Pocket ID is pretty simple to use and has a very nice interface to add your users and clients. Uncluttered and straight and to the point. Pocket ID doesn't use UN/PW Combos. Instead, you use Passkeys as in webAuthn devices to log in, which IMHO is one of the better security paths.

https://github.com/pocket-id/pocket-id

[–] sxan@midwest.social 1 points 2 weeks ago (3 children)

If Pocket ID and Passkeys are like most modern "solutions", they ignore everything that isn't web, or human. Have you hooked any services together using it? Like having Home Assistant authenticate against mpd?

[–] node815@lemmy.world 1 points 1 week ago (1 children)

I have several services. Home Assistant is not one as it's still a WIP for the person who's developing a solution. It works, but I'm sort of holding off until I can test it more with the mobile app.

https://github.com/christiaangoossens/hass-oidc-auth

But, to answer your question: I log into Tailscale with it. I also have it connected to Proxmox and Portainer Additionally, I have it connected to Pomerium so I can log into my FreshTomato Router with a fingerprint :) I also have a self hosted PasteBin connected to it.

[–] sxan@midwest.social 1 points 1 week ago

So... you have applications that aren't web apps, authenticating themselves with other applications that aren't web applications? Not proxying for you, but literally connecting to do something, like perform a backup.

load more comments (2 replies)
load more comments (3 replies)
[–] mongoose@lemm.ee 10 points 2 weeks ago* (last edited 2 weeks ago)

FreeIPA + Keycloak

FreeIPA includes Kerberos so the SSO extends to Linux logins. Further, Keycloak supports Kerberos so if I'm logged in on an FreeIPA enrolled client Keycloak is transparent with no additional password. Thus, anything I can goes through Keycloak, otherwise manual LDAP to FreeIPA.

FreeIPA also handles most of my homelab's DNS and honestly was not too hard to setup. I'm running it in a Alma Linux VM on Proxmox so it will be supported for a while.

[–] Shimitar@downonthestreet.eu 10 points 2 weeks ago

Authelia.

Learn it, its worth while.

Nice and easy. I set it up on the server itself, no container.

See https://wiki.gardiol.org/doku.php?id=selfhost%3Asso and https://wiki.gardiol.org/doku.php?id=services%3Aauthelia

[–] steventhedev@lemmy.world 8 points 2 weeks ago* (last edited 2 weeks ago) (5 children)

Keycloak might seem a little daunting to start with, but is basically glue between your idp (ldap) and whatever apps need to authenticate.

[–] Grunt4019@lemm.ee 5 points 2 weeks ago (1 children)

My issue with keycloak is that the documentation is very poor as a beginner. It and almost any other guides online assume you already know things that you may not so I wasn’t able to get past that hurdle.

[–] steventhedev@lemmy.world 1 points 2 weeks ago

Strongly agree. A guide for dead simple setups would be incredibly useful (e.g. gsuite as idp, oauth for a single app).

It took me a few days to get that basic setup working, and a few days more to improve it. But once it was up, it was rock solid.

[–] jaark@infosec.pub 4 points 2 weeks ago

Another for Keycloak. Though it is probably overkill for many people's needs in here - it certainly is for mine! But it is what I have up and running and see no need to change to a simpler option.

[–] towerful@programming.dev 1 points 2 weeks ago

And keycloak has a decent k8s operator, making deployment on a k8s cluster a breeze

[–] AddiXz 1 points 2 weeks ago

Plus one for Keycloak here. Initially it may be a bit daunting but once it's set it's a rock and works flawlessly!

[–] mhzawadi@lemmy.horwood.cloud 1 points 2 weeks ago

Keycloak here, I plugged my keycloak into my Google workspace. Yes I know Google!!

But the login flow is amazing and I get all the MFA without the faff

[–] retro@infosec.pub 8 points 2 weeks ago (1 children)

LLDAP + Authelia

I actually moved from Authentik to Authelia because it was easier for me to add a couple of lines to a yaml than to navigate Authentik's web ui. Authentik is more feature-full but I'm only running SSO for myself and a couple of others at home.

[–] sxan@midwest.social 1 points 2 weeks ago

Yeah, that sounds ideal. I'd prefer editing a file than administering through a web page.

I'm checking Authelia right now.

SSO is part, but not all, of the picture. There's also multi-system passwords, for things like sudo, and non-web service authentication; most of the stuff like OAUTH is really hacky to make work outside of web environments.

I've considered Vault for some of the inter-service authentication, but there's not broad support built into services and it's yet another thing to mess with.

LDAP forms a good base for most use cases, and so keeping it as the source of truth is important for me. And then, as few other layers on top to get SSO. Authelia is looking like the best solution.

[–] keyez@lemmy.world 8 points 2 weeks ago (2 children)

I used to run key cloak backed by LDAP. Few months ago moved to Authelia and after many hours of tinkering and setting up sites I haven't had to touch it except to add a new URL or user.

I slightly disagree with the other commenter I didn't find it easy or straightforward but once I finally found what worked for my setup its been great.

Imagine Authelia is the caddy of SSO. Powerful, intimidating but very efficient. Also all configs are in like 3 files and things aren't going to change without FS access which only I the admin have.

[–] scrubbles@poptalk.scrubbles.tech 2 points 2 weeks ago (2 children)

I've tried and failed a couple of times, would you mind sharing (or dming) your example config? Maybe I'm just a been with sso and can't figure it out

[–] keyez@lemmy.world 2 points 2 weeks ago (1 children)

Certainly, I'll post it tomorrow

[–] keyez@lemmy.world 1 points 2 weeks ago

Heres what I'm running:

authentication_backend:
  file:
    path: '/config/users_database.yml'
    watch: false
    search:
      email: false
      case_insensitive: false
    password:
      algorithm: 'sha2crypt'

access_control:
  ## Default policy can either be 'bypass', 'one_factor', 'two_factor' or 'deny'. It is the policy applied to any
  ## resource if there is no policy to be applied to the user.
  default_policy: 'deny'

  networks:
    - name: 'internal'
      networks:
        # - '10.10.0.0/16'
        - '192.168.1.0/24'
    - name: 'VPN'
      networks: '10.0.1.0/24'

  rules:
    ## Rules applied to everyone
    - domain: '*.mydomain.com'
      policy: 'one_factor'

session:
  ## The secret to encrypt the session data. This is only used with Redis / Redis Sentinel.
  ## Secret can also be set using a secret: https://www.authelia.com/c/secrets
  secret: 'insecure_session_secret'

  ## Cookies configures the list of allowed cookie domains for sessions to be created on.
  ## Undefined values will default to the values below.
  cookies:
  #   -
      ## The name of the session cookie.
    - name: 'authelia_session'

      ## The domain to protect.
      ## Note: the Authelia portal must also be in that domain.
      domain: 'mydomain.com'

      ## Required. The fully qualified URI of the portal to redirect users to on proxies that support redirections.
      ## Rules:
      ##   - MUST use the secure scheme 'https://'
      ##   - The above 'domain' option MUST either:
      ##      - Match the host portion of this URI.
      ##      - Match the suffix of the host portion when prefixed with '.'.
      authelia_url: 'https://auth.mydomain.com/'
storage:
  postgres:
    ....

identity_providers:
  oidc:
    ## Cross-Origin Resource Sharing (CORS) settings.
    cors:
      ## List of endpoints in addition to the metadata endpoints to permit cross-origin requests on.
      endpoints:
         - 'authorization'
         - 'token'
         - 'revocation'
         - 'introspection'
        #  - 'pushed-authorization-request'
        #  - 'userinfo'

      ## List of allowed origins.
      ## Any origin with https is permitted unless this option is configured or the
      ## allowed_origins_from_client_redirect_uris option is enabled.
      allowed_origins:
        - 'https://mydomain.com/'
        - 'https://grafana.mydomain.com/'
        - 'https://wiki.mydomain.com/'
        - 'https://foodz.mydomain.com/'

      ## Automatically adds the origin portion of all redirect URI's on all clients to the list of allowed_origins,
      ## provided they have the scheme http or https and do not have the hostname of localhost.
      allowed_origins_from_client_redirect_uris: true
    ## Clients is a list of known clients and their configuration.
    clients:
      - client_id: 'grafana'
        client_name: 'Grafana'
        client_secret: 'XXXXXX'
        public: false
        consent_mode: 'pre-configured'
        authorization_policy: 'one_factor'
        require_pkce: true
        pkce_challenge_method: 'S256'
        redirect_uris:
          - 'https://grafana.mydomain.com/login/generic_oauth'
        scopes:
          - 'openid'
          - 'profile'
          - 'groups'
          - 'email'
        userinfo_signed_response_alg: 'none'
        token_endpoint_auth_method: 'client_secret_basic'
      - client_id: 'wiki'
        client_name: 'Wiki'
        client_secret: 'XXXX'
        consent_mode: 'pre-configured'
        public: false
        authorization_policy: 'one_factor'
        require_pkce: true
        pkce_challenge_method: 'S256'
        redirect_uris:
          - 'https://wiki.mydomain.com/oidc/callback'
        scopes:
          - 'openid'
          - 'profile'
          - 'groups'
          - 'email'
        userinfo_signed_response_alg: 'none'
        token_endpoint_auth_method: 'client_secret_basic'
      ....

Then my users_database.yml looks like:

users:
  authelia:
    disabled: false
    displayname: "Test User"
    password: ""
    email: authelia@authelia.com
    groups:
      - admins
      - dev
  user001:
    disabled: false
    displayname: 'User 001'
    password: "$6$rounds=50000$XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    email: test@gmail.com
    groups:
      - admins
      - users
[–] sxan@midwest.social 2 points 2 weeks ago

Caddy is anything but intimidating! If Authelia is anything like Caddy in ease of use, sign me up!

[–] hendrik@palaver.p3x.de 6 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

I use KaniDM and configured everything with OAuth2. That was the easiest and most straightforward I could find. But I don't think they bothered implementing LDAP. Other platforms I tried are Authentik, Authelia, Keycloak, Zitadel... They're all a bit heavier and have other/more features, but there wasn't one I really fell in love with.

[–] 2xsaiko@discuss.tchncs.de 2 points 2 weeks ago* (last edited 2 weeks ago)

Kanidm has LDAP support but it’s read-only. You should prefer OAuth though since LDAP is locked to password login.

[–] Nibodhika@lemmy.world 6 points 2 weeks ago (1 children)

I tried Authelia but couldn't set it up, so I've been using Authentik and have been quite happy. The only downside is that I had to configure it using the GUI instead of with config files, which I think would have been a point for Authelia, but couldn't get it to work properly.

[–] uninvitedguest@lemmy.ca 2 points 2 weeks ago

Sounds like you need to talk with @retro@infosec.pub from elsewhere in this comment section.

[–] parrhesia@sh.itjust.works 4 points 2 weeks ago

I use authentik

[–] irotsoma@lemmy.blahaj.zone 4 points 2 weeks ago (1 children)

Keycloak. Took me a bit to learn the basics, but it has been way easier to troubleshoot than Authentik and has more features. If you need something that mimics LDAP rather than syncing with an existing LDAP, then Authentik is pretty good. I don't use LDAP, though.

[–] sxan@midwest.social 1 points 2 weeks ago (1 children)

Yeah, I want to keep my LDAP. Whatever sits on top has to use it as a backend.

[–] irotsoma@lemmy.blahaj.zone 2 points 2 weeks ago

If you want to keep your LDAP as the source of truth, then Keycloak is also a very good option. I did that originally, but decided I only had a couple of things needing LDAP and that wasn't worth keeping it around. Authentik was a good way to emulate an LDAP but with a different back end. But Keycloak is definitely my recommendation in your case.

[–] qaz@lemmy.world 3 points 2 weeks ago

I use Keycloak

[–] Lyricism6055@lemmy.world 2 points 1 week ago

For my web ui apps I just use traefik forward auth with Google. Works great for my use case

[–] Xanza@lemm.ee 1 points 2 weeks ago* (last edited 2 weeks ago) (1 children)
[–] sxan@midwest.social 3 points 2 weeks ago

Yes! I've used that page extensively. It doesn't, however, address SSO.

load more comments
view more: next ›