private static AcsAccessToken doLoginSsoLdap(String name, int productId, String entidad) throws Exception { AcsAccessToken token = null; if (_logger.isDebugEnabled()) _logger.debug("doLoginSsoLdap"); switch (productId) { case ISicresAdminUserDefsKeys.PRODUCT_SYSTEM: { token = LoginManager.iDocAdmAppDoSsoLoginLdap(name, entidad); break; } case ISicresAdminUserDefsKeys.PRODUCT_USER: { token = LoginManager.iUserAdmAppDoSsoLoginLdap(name, entidad); break; } case ISicresAdminUserDefsKeys.PRODUCT_VOLUME: { token = LoginManager.iVolAdmAppDoSsoLoginLdap(name, entidad); break; } default: { ISicresAdminBasicException.throwException(ISicresAdminLoginKeys.EC_INVALID_PRODUCT_ID); } } return token; }
public static AcsAccessTokenProducts doAdmLogin( String name, String password, int numTries, String entidad) throws Exception { AcsAccessTokenProducts token = null; int method; if (_logger.isDebugEnabled()) _logger.debug("doAdmLogin"); DbConnection dbConn = new DbConnection(); try { dbConn.open(DBSessionManager.getSession()); LoginManager loginMetod = new LoginManager(); method = loginMetod.getLoginMethod(dbConn); switch (method) { case LoginMethod.STANDARD: { token = LoginManager.doAdmLoginStd(name, password, numTries, entidad); break; } case LoginMethod.LDAP: { token = LoginManager.doAdminLoginLdap(name, password, numTries, entidad); break; } case LoginMethod.SSO_LDAP: { token = LoginManager.doAdmSsoLoginLdap(name, entidad); break; } default: { ISicresAdminBasicException.throwException(ISicresAdminLoginKeys.EC_INVALID_PRODUCT_ID); } } } catch (Exception e) { _logger.error(e); throw e; } finally { dbConn.close(); } return token; }