pixelfed / pixelfed

Photo Sharing. For Everyone.
https://pixelfed.org
GNU Affero General Public License v3.0
5.59k stars 662 forks source link

Implement SSO options #2089

Open hellcp opened 4 years ago

hellcp commented 4 years ago

For integration into existing infrastructures, we should have an option for setting up auth with LDAP, SAML or OpenID Connect. One of many reasons why Debian Social might have issues with integrating Pixelfed into their existing login system.

Thatoo commented 4 years ago

Mastodon, Pleroma, Peertube all implement LDAP now so they all integrate perfectly well in project like Yunohost and Freedombox.

RealBurgerGod commented 4 years ago

I'd love to have one login to rule them all... Looking forward to ldap/sso support!

rasos commented 3 years ago

LDAP is being superseded at many organisations with oAuth2 / OpenID Connect. This gives the users a seamless experience by offering the login token without the need to enter username and password at each service. We use keycloak for identity management, which also can connect to an OpenLDAP or AD user base.

mprajescu commented 3 years ago

Just checking... are there any updates on this?

aleighco commented 3 years ago

Also looking for LDAP

jakehamilton commented 3 years ago

Would love to see OIDC support added so I can roll pixelfed out under my existing infrastructure.

ser commented 3 years ago

I would vote for SAML - it's much more flexible than LDAP and can also integrate LDAP among others

p00rt commented 2 years ago

hey, this was added to 0.11.0 project. are there any updates on this feature? lack of OAUTH is basically a dealbraker for me :c

decentral1se commented 2 years ago

Have an existing online 100+ user group with Keycloak accounts (OpenID Connect) who want to use pixelfed for a trial run and I just can't do it without SSO options. Glad to see this ticket and hoping to see it get implemented one day. Thanks for all the work so far.

ghost commented 2 years ago

+1 for LDAP as a starting point. On top of this other auth mechanisms can be built, I think...

ser commented 2 years ago

It's completely opposite, SAML is a basis for authentication, LDAP can be one of its account verification sources.

jakehamilton commented 2 years ago

Chiming back in, I have a similar situation to @decentral1se. Currently running Keycloak and planning to migrate to Ory so OAuth / OIDC would be needed to support this.

I have next to no experience in PHP so I won't be of much help, but is anyone else interested in working on this? Perhaps we could outline what needs to be done here so that someone could contribute the feature?

jakehamilton commented 2 years ago

I'll also mention that choosing OIDC would let people using other providers easily integrate by proxying with Dex. That way everyone gets support while Pixelfed only needs to target one provider.

sama8 commented 2 years ago

If relevant -> SAML Jackson

Lurkars commented 2 years ago

+1 for OpenID Connect.

osresearch commented 2 years ago

I have PixelFed working with Keycloak OIDC for SSO, although the pull requests would really appreciate eyes from someone who knows PHP. https://github.com/pixelfed/pixelfed/pull/3436

jakehamilton commented 2 years ago

@osresearch this looks very promising! I've limited PHP experience so I won't be of much use outside of general code quality comments. Though, right now I'm not sure that's what this PR needs since it is in flux.

twe-syde commented 1 year ago

Are there any news on that? Since I, like many others these days, plan to set up an own Mastodon instance that can act as an OpenID Connect provider, it would be great to have pixelfed client-side support as well.

osresearch commented 1 year ago

I've rebased my OIDC patches to dev 2bb27229f3f8c315d193010106fc328b6f3ac578 and it seems to work, although there will also probably need to be some hacks to support the mobile app. Currently when I try to connect to my test server via the app it gets the /api/nodeinfo/2.0.json and then tries to post to the /api/v1/apps endpoint, but fails to make further progress.

osresearch commented 1 year ago

The SSO patches in #3436 are working well enough for our small community that we've moved it from testing into production and folks are using it with the testflight mobile app. One note is that OAUTH_ENABLED has to be turned on in the config to allow the app to connect to the server.

jdkruzr commented 1 year ago

Hi -- are we getting close to OIDC being usable? I'd love to go with that instead of "raw" LDAP since the way I do LDAP for Mastodon is with OIDC -> Keycloak -> LDAP (which has the added benefit of effectively creating a self-registration portal for my LDAP directory).

osresearch commented 1 year ago

@jdkruzr login via Keycloak is working well enough for our small community, both via the web site and the app. I've pushed a docker image that has the patches applied and deployed in production via https://git.v.st/vst/env/src/branch/single-dockerfile/pixelfed.yaml

jdkruzr commented 1 year ago

@jdkruzr login via Keycloak is working well enough for our small community, both via the web site and the app. I've pushed a docker image that has the patches applied and deployed in production via https://git.v.st/vst/env/src/branch/single-dockerfile/pixelfed.yaml

thanks. my deployment is "bare metal" so hopefully this gets merged in soon!

w4tsn commented 1 year ago

As others already mentioned OIDC is the latest authentication standard and allows to connect arbitrary oauth2 providers and use other source such as LDAP through an authentication provider like keycloak or kanidm. While e.g. keycloak also supports SAML the SAML method is slow and rather convoluted compared to OIDC, so I think OIDC deserves prio here

osresearch commented 1 year ago

The recent "Add Sign-in with Mastodon" changes implemented a remote user model that is specialized for talking to a Mastodon server, rather than using OIDC. I had hoped that this patch (or something similar) could have been cleaned up and merged instead of special-casing the remote auth to a single provider.

Perhaps the code in RemoteAuthService.php can be hacked to support OIDC instead, although I haven't had time to dig into it. The Mastodon sign-on also doesn't have any role support or single-sign-off, so there are other things that would need to be added to bring it up to parity with this PR.

jdkruzr commented 1 year ago

would be nice! I would also accept fixing the LDAP login problem where it tries to auth users via an LDAP attribute ("email") that doesn't exist.

xundeenergie commented 6 months ago

I would be happy, if OIDC will work with pixelfed...