Software /
code /
prosody
Comparison
plugins/mod_auth_internal_plain.lua @ 5302:52fe5df91c65
mod_auth_internal_plain, mod_auth_internal_hashed: No need to nodeprep here.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 22 Jan 2013 08:26:08 +0500 |
parent | 5156:6b08c922a2e4 |
child | 5500:eeea0eb2602a |
comparison
equal
deleted
inserted
replaced
5301:6279caf921f1 | 5302:52fe5df91c65 |
---|---|
7 -- | 7 -- |
8 | 8 |
9 local datamanager = require "util.datamanager"; | 9 local datamanager = require "util.datamanager"; |
10 local usermanager = require "core.usermanager"; | 10 local usermanager = require "core.usermanager"; |
11 local new_sasl = require "util.sasl".new; | 11 local new_sasl = require "util.sasl".new; |
12 local nodeprep = require "util.encodings".stringprep.nodeprep; | |
13 | 12 |
14 local log = module._log; | 13 local log = module._log; |
15 local host = module.host; | 14 local host = module.host; |
16 | 15 |
17 -- define auth provider | 16 -- define auth provider |
65 end | 64 end |
66 | 65 |
67 function provider.get_sasl_handler() | 66 function provider.get_sasl_handler() |
68 local getpass_authentication_profile = { | 67 local getpass_authentication_profile = { |
69 plain = function(sasl, username, realm) | 68 plain = function(sasl, username, realm) |
70 local prepped_username = nodeprep(username); | 69 local password = usermanager.get_password(username, realm); |
71 if not prepped_username then | |
72 log("debug", "NODEprep failed on username: %s", username); | |
73 return "", nil; | |
74 end | |
75 local password = usermanager.get_password(prepped_username, realm); | |
76 if not password then | 70 if not password then |
77 return "", nil; | 71 return "", nil; |
78 end | 72 end |
79 return password, true; | 73 return password, true; |
80 end | 74 end |