if (not password) or (password == "") or (not authentication) or (authentication == "") then
log("debug", "Username or password violates SASLprep.");
- return "failure", "malformed-request";
+ return "failure", "malformed-request", "Invalid username or password.";
end
local correct, state = false, false;
if correct then
return "success";
else
- return "failure", "not-authorized";
+ return "failure", "not-authorized", "Unable to authorize you with the authentication credentials you've sent.";
end
end
self.state.name = validate_username(self.state.name);
if not self.state.name then
log("debug", "Username violates either SASLprep or contains forbidden character sequences.")
- return "failure", "malformed-request";
+ return "failure", "malformed-request", "Invalid username.";
end
self.state["servernonce"] = generate_uuid();
self.state["nonce"] = client_final_message:match("r=(.+),p=");
self.state["channelbinding"] = client_final_message:match("c=(.+),r=");
if not self.state.proof or not self.state.nonce or not self.state.channelbinding then
- return "failure", "malformed-request";
+ return "failure", "malformed-request", "Missing an attribute(p, r or c) in SASL message.";
end
local password;
password = saslprep(password);
if not password then
log("debug", "Password violates SASLprep.");
- return "failure", "not-authorized"
+ return "failure", "not-authorized", "Invalid password."
end
end