Comparison

mod_sasl2/mod_sasl2.lua @ 5048:3697d19d5fd9

mod_sasl2: Store client id if provided
author Matthew Wild <mwild1@gmail.com>
date Thu, 22 Sep 2022 16:48:05 +0100
parent 5044:f64d834ba744
child 5049:e89aad13a52a
comparison
equal deleted inserted replaced
5047:023f21bfcc08 5048:3697d19d5fd9
189 end 189 end
190 local mechanism = assert(auth.attr.mechanism); 190 local mechanism = assert(auth.attr.mechanism);
191 if not sasl_handler:select(mechanism) then 191 if not sasl_handler:select(mechanism) then
192 return handle_status(session, "failure", "invalid-mechanism"); 192 return handle_status(session, "failure", "invalid-mechanism");
193 end 193 end
194 local user_agent = auth:get_child("user-agent");
195 if user_agent then
196 session.client_id = user_agent.attr.id;
197 end
194 local initial = auth:get_child_text("initial-response"); 198 local initial = auth:get_child_text("initial-response");
195 return process_cdata(session, initial); 199 return process_cdata(session, initial);
196 end); 200 end);
197 201
198 module:hook_tag(xmlns_sasl2, "response", function (session, response) 202 module:hook_tag(xmlns_sasl2, "response", function (session, response)