}
}
public static Identity authenticate(String username, String pwd, LDAPError ldapError) {
LDAPLoginManager ldapManager = LDAPLoginManager.getInstance();
Attributes attrs = ldapManager.bindUser(username, pwd, ldapError);
if (ldapError.isEmpty() && attrs != null) {
Identity identity = ldapManager.findIdentyByLdapAuthentication(username, ldapError);
if (!ldapError.isEmpty()) return null;
if (identity == null) {
// User authenticated but not yet existing - create as new OLAT user