summaryrefslogtreecommitdiffstats
path: root/api/authentication.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/authentication.go')
-rw-r--r--api/authentication.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/api/authentication.go b/api/authentication.go
index 42a395253..8170f0a8e 100644
--- a/api/authentication.go
+++ b/api/authentication.go
@@ -9,6 +9,7 @@ import (
"github.com/mattermost/platform/utils"
"net/http"
+ "strings"
)
func checkPasswordAndAllCriteria(user *model.User, password string, mfaToken string) *model.AppError {
@@ -145,7 +146,11 @@ func authenticateUser(user *model.User, password, mfaToken string) (*model.User,
return ldapUser, nil
}
} else if user.AuthService != "" {
- err := model.NewLocAppError("login", "api.user.login.use_auth_service.app_error", map[string]interface{}{"AuthService": user.AuthService}, "")
+ authService := user.AuthService
+ if authService == model.USER_AUTH_SERVICE_SAML || authService == model.USER_AUTH_SERVICE_LDAP {
+ authService = strings.ToUpper(authService)
+ }
+ err := model.NewLocAppError("login", "api.user.login.use_auth_service.app_error", map[string]interface{}{"AuthService": authService}, "")
err.StatusCode = http.StatusBadRequest
return user, err
} else {