Software /
code /
prosody
File
util/sasl/external.lua @ 13386:33e5edbd6a4a
mod_saslauth: Fire event per SASL step
This matches the behaviour of the newer mod_sasl2 implementation. It allows
plugins to observe (and potentially, with caution, modify) the SASL exchange.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 05 Dec 2023 11:39:11 +0000 |
parent | 12975:d10957394a3c |
line wrap: on
line source
local saslprep = require "prosody.util.encodings".stringprep.saslprep; local _ENV = nil; -- luacheck: std none local function external(self, message) message = saslprep(message); local state self.username, state = self.profile.external(message); if state == false then return "failure", "account-disabled"; elseif state == nil then return "failure", "not-authorized"; elseif state == "expired" then return "false", "credentials-expired"; end return "success"; end local function init(registerMechanism) registerMechanism("EXTERNAL", {"external"}, external); end return { init = init; }