Этот коммит содержится в:
Ben Cooke
2025-05-12 23:41:54 +01:00
коммит произвёл GitHub
родитель f302b9844e
Коммит b6b0c269c4
2 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@@ -182,10 +182,16 @@ func completeSaml(c *Context, w http.ResponseWriter, r *http.Request) {
AcceptLanguage: c.AppContext.AcceptLanguage(),
UserAgent: c.AppContext.UserAgent(),
}
var hookErr error
c.App.Channels().RunMultiHook(func(hooks plugin.Hooks, manifest *model.Manifest) bool {
err := hooks.OnSAMLLogin(pluginContext, user, assertion)
return err == nil
hookErr = hooks.OnSAMLLogin(pluginContext, user, assertion)
return hookErr == nil
}, plugin.OnSAMLLoginID)
if hookErr != nil {
handleError(model.NewAppError("completeSaml", "api.user.authorize_oauth_user.saml_hook_error.app_error", nil, "", http.StatusInternalServerError).Wrap(hookErr))
return
}
auditRec.AddMeta("obtained_user_id", user.Id)
c.LogAuditWithUserId(user.Id, "obtained user")

Просмотреть файл

@@ -3922,6 +3922,10 @@
"id": "api.user.authorize_oauth_user.response.app_error",
"translation": "Received invalid response from OAuth service provider."
},
{
"id": "api.user.authorize_oauth_user.saml_hook_error.app_error",
"translation": "An error occurred in the OnSamlLogin hook. Please contact your System Administrator."
},
{
"id": "api.user.authorize_oauth_user.saml_response_too_long.app_error",
"translation": "SAML response is too long"