43 end |
43 end |
44 end |
44 end |
45 end |
45 end |
46 |
46 |
47 -- create a new SASL object which can be used to authenticate clients |
47 -- create a new SASL object which can be used to authenticate clients |
48 function new(realm, service_name) |
48 function new(realm, service_name, app_name) |
49 local sasl_i = {}; |
49 local sasl_i = {}; |
50 |
50 |
51 init(service_name); |
51 init(app_name or service_name); |
52 |
52 |
53 sasl_i.realm = realm; |
53 sasl_i.realm = realm; |
54 sasl_i.service_name = service_name; |
54 sasl_i.service_name = service_name; |
55 |
55 |
56 local st, ret = pcall(cyrussasl.server_new, service_name, nil, realm, nil, nil) |
56 local st, ret = pcall(cyrussasl.server_new, service_name, nil, realm, nil, nil) |