traggo / server

self-hosted tag-based time tracking
https://traggo.net
GNU General Public License v3.0
1.08k stars 55 forks source link

Support for authelia (SSO) #95

Open TheFrazer opened 3 years ago

TheFrazer commented 3 years ago

Is your feature request related to a problem? Please describe. I am using a SSO (authelia) infront of all my services. Having to login a second time to traggo is something I would like to eliminate.

Describe the solution you'd like Some auth-proxys (like authelia) add header to each request. Applications secured by such a SSO then just need to check for the HTTP header and automatically login the user. In my case a Remote-User header which contains the username is set. Would it be possible to add an option to look for such a header and autologin the user if present? It doesn't have any security strings attached, since all security relevant parts are done by the auth server.

jmattheis commented 3 years ago

It would be possible, but I don't think that a lot of users are affected by this, thus, I don't think it is worth the effort to implement / maintain this.

TheFrazer commented 2 years ago

Ok, that's understandable. I got it roughly to work, but good enough for me (never used Go before). If you want to, you can close this issue. Otherwise I would leave it open in case others are interested.

c-nv-s commented 2 years ago

shame. I would have liked to use this with authelia too

TheFrazer commented 2 years ago

@c-nv-s I ended up adding this piece of code in the reqisterUser (not a typo, thats the correct method name :P) method in the middleware.go file in the auth folder. Just at the top. Be aware that I never worked with Go and my code doesn't add a proper device or even create a session, but you get logged in if your username exists and it seems to work for me...

header := request.Header.Get("Remote-User")
if len(header) != 0 {
    log.Debug().Str("header", header).Msg("login with Header")

    user := &model.User{}
    if db.Where("name = ?", header).Find(user).RecordNotFound() {
        log.Warn().Str("user", header).Msg("User from Header not found")
    } else {
        return request.WithContext(WithUser(request.Context(), user))
    }
}
rpoovey commented 1 year ago

Its been a couple years since this was requested. I think due to the growing number of self hosted applications everyone wants to make their logins easier. Is this something that can be revisited?

jmattheis commented 1 year ago

Sure, I'm open to accept PRs for this feature, tho the build pipeline should probably be fixed / migrated to github before that.

max-tet commented 7 months ago

I'd like to upvote this feature request. It would be very useful for me and surely for many others.

Leptopoda commented 6 months ago

While we are not using authelia we would love to see SSO. OIDC would probably be great to see :)

b1tray3r commented 1 month ago

This feature would be nice. OIDC is perfectly fine with me. :)