-
-
Notifications
You must be signed in to change notification settings - Fork 884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow external authentication? #489
Comments
I'm sure some other people could chime in, because I don't know how the middle layer would function. But the easiest way would be to use the http API, and create a user with the correct user / pass, and it'll give you the auth / jwt token, which you can then pass to the user. You might even be able to do the blocking with nginx, but I'm not too knowledgeable on how it would work. Lemmy itself uses no headers, just a single jwt / auth string, and all authenticated requests require the |
Using SAML/OAuth/OpenID as an authentication mechanism and then issuing a token from Lemmy's side would be great too. This is how most apps I've deployed work. Alternatively, (a) requiring email confirmation and (b) requiring emails to be |
I don't have time for this one in the near future, but if anyone wants to have a go at it, go right ahead. |
Oauth2 / OpenID Connect is the way to go and would allow Lemmy to link to account providers like Gitea or Nextcloud easily. There are some nice rust client libraries for it too. |
@dessalines would you still be open to contributions regarding OAuth? |
Of course, I just personally don't have time to do them. |
If anyone makes a start at implementing this I'd glady support with testing it! |
Hi guys, I'll gladly help with this, since i need it bad. |
Check out the |
Thanks! |
I'm not too familiar with oauth, but using a third party login still means that the first oauth request would have to create a lemmy account. No idea how that would work with registration applications and all that. |
mmmh I've never implemented such a flow, I have to think about how to do it. |
Correct. You need to have an account. I think ppl are talking about two different things here.
|
I've been looking around for a Reddit-like option for a self-hosted application. Lemmy looks like a great opportunity for what I need, especially with the RSS feeds.
That said, I need to be able to authenticate to an external resource so I can use the reverse proxy sitting in front of Lemmy to completely restrict access to the site until a user has authenticated with our SSO platform (could be JWT, OpenID, SAML, Basic Auth, whatev).
I think there's a couple of ways to implement this, but I'm not (yet) a Rust developer or I'd hack it in and do a PR.
The simplest would be to allow a trusted header that would be set by the reverse proxy with the authenticated user ID (probably email address, but maybe username). The login process of lemmy would check if this header is set, and if so authenticate and set the
jwt
cookie appropriately.The reverse proxy could use middleware to authenticate the user and set a jwt token as an authorization header or maybe in the jwt cookie. Lemmy could check these two locations for a valid jwt token and authenticate the session, populating the rest of the cookie. This of course would mean that the jwt secret would be shared between the middleware and lemmy, allowing the signatures to validate.
Thanks for the consideration!
The text was updated successfully, but these errors were encountered: