$groups is not initialize for at least LDAP authentication
Environment
LemonLDAP::NG version: 2.0.10
Summary
- groups is not define if LDAP user has no group
- LLNG can't use
usergroup = $groups
as an exported attribute to an SAML SP provider if groups is not define
Step to reproduce
- Set LDAP authentication and LDAP groups
- Add LDAP user with no LDAP groups
- Try to use $groups (in SAML attribut for example or groups=testgroups)
- Try this with the user.
Expected behavior
- Initialize
groups =""
if user has no group as intended in 3660dc24 thanks tomy $groups = "";
Temporary patch
- We can use a SP macro in order to set
usergroup =$groups ||= ""
. Then use the usergroup var which is always define
More informations
- $groups work as intended when the user has a group.
- Using non define groups in a macro
isintestgroups -> groups=testgroups
set groups to testgroups instead of returning 0. I think LLNG should throw an error in this case. - I couldn't find any relevant debug log to share.