From 7649d93d17edcc0814686cc152aa4a4e52739c27 Mon Sep 17 00:00:00 2001 From: Jo Date: Tue, 26 Mar 2024 09:24:24 +0100 Subject: [PATCH] AuthProxy: Fix missing session for ldap auth proxy users (#85090) fix missing session for ldap auth proxy users --- pkg/api/login.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/api/login.go b/pkg/api/login.go index 71030800a12..71a7251242b 100644 --- a/pkg/api/login.go +++ b/pkg/api/login.go @@ -126,9 +126,10 @@ func (hs *HTTPServer) LoginView(c *contextmodel.ReqContext) { if c.IsSignedIn { // Assign login token to auth proxy users if enable_login_token = true + // LDAP users authenticated by auth proxy are also assigned login token but their auth module is LDAP if hs.Cfg.AuthProxy.Enabled && hs.Cfg.AuthProxy.EnableLoginToken && - c.SignedInUser.AuthenticatedBy == loginservice.AuthProxyAuthModule { + (c.SignedInUser.AuthenticatedBy == loginservice.AuthProxyAuthModule || c.SignedInUser.AuthenticatedBy == loginservice.LDAPAuthModule) { user := &user.User{ID: c.SignedInUser.UserID, Email: c.SignedInUser.Email, Login: c.SignedInUser.Login} err := hs.loginUserWithUser(user, c) if err != nil {