Merge staging/1.1.0 changes back to master.

This commit is contained in:
Virtually Nick
2020-01-24 02:20:26 -05:00

View File

@@ -204,18 +204,26 @@ public class AuthenticationProviderService {
// Attempt bind // Attempt bind
LdapNetworkConnection ldapConnection = ldapService.bindAs(bindDn, password); LdapNetworkConnection ldapConnection = ldapService.bindAs(bindDn, password);
try {
// Retrieve group membership of the user that just authenticated // Retrieve group membership of the user that just authenticated
Set<String> effectiveGroups = Set<String> effectiveGroups =
userGroupService.getParentUserGroupIdentifiers(ldapConnection, userGroupService.getParentUserGroupIdentifiers(ldapConnection,
bindDn); bindDn);
// Return AuthenticatedUser if bind succeeds // Return AuthenticatedUser if bind succeeds
LDAPAuthenticatedUser authenticatedUser = authenticatedUserProvider.get(); LDAPAuthenticatedUser authenticatedUser = authenticatedUserProvider.get();
authenticatedUser.init(credentials, getAttributeTokens(ldapConnection, authenticatedUser.init(credentials, getAttributeTokens(ldapConnection,
bindDn), effectiveGroups, bindDn); bindDn), effectiveGroups, bindDn);
return authenticatedUser; return authenticatedUser;
}
// Always disconnect
finally {
ldapService.disconnect(ldapConnection);
}
} }