use of com.zimbra.common.account.ZAttrProvisioning.AutoProvAuthMech in project zm-mailbox by Zimbra.
the class AutoProvisionLazy method auth.
private AutoProvAuthMech auth() {
String authMechStr = domain.getAttr(Provisioning.A_zimbraAuthMech);
AuthMech authMech = null;
try {
authMech = AuthMech.fromString(authMechStr);
} catch (ServiceException e) {
ZimbraLog.autoprov.debug("invalid auth mech " + authMechStr, e);
}
// only support external LDAP auth for now
if (AuthMech.ldap == authMech || AuthMech.ad == authMech) {
Map<String, Object> authCtxt = new HashMap<String, Object>();
try {
prov.externalLdapAuth(domain, authMech, loginName, loginPassword, authCtxt);
return AutoProvAuthMech.LDAP;
} catch (ServiceException e) {
ZimbraLog.autoprov.info("unable to authenticate " + loginName + " for auto provisioning", e);
}
} else if (AuthMech.kerberos5 == authMech) {
try {
Krb5Login.verifyPassword(loginName, loginPassword);
return AutoProvAuthMech.KRB5;
} catch (LoginException e) {
ZimbraLog.autoprov.info("unable to authenticate " + loginName + " for auto provisioning", e);
}
} else {
// unsupported auth mechanism for lazy auto provision
// Provisioning.AM_CUSTOM is not supported because the custom auth
// interface required a Zimrba Account instance.
}
return null;
}
Aggregations