account = prov.get(AccountBy.ID, value);
account = prov.get(AccountBy.id, value);
	public Element handle(Element request, Map<String, Object> context) throws ServiceException {        ZimbraSoapContext lc = getZimbraSoapContext(context);        Element a = request.getElement(AdminService.E_ACCOUNT);        String key = a.getAttribute(AdminService.A_BY);        String value = a.getText();        long lifetime = request.getAttributeLong(AdminService.A_DURATION, DEFAULT_AUTH_LIFETIME) * 1000;        		Provisioning prov = Provisioning.getInstance();                Account account = null;        if (key.equals(BY_NAME)) {            account = prov.get(AccountBy.NAME, value);        } else if (key.equals(BY_ID)) {            account = prov.get(AccountBy.ID, value);        } else {            throw ServiceException.INVALID_REQUEST("unknown value for by: "+key, null);        }        if (account == null)            throw AccountServiceException.NO_SUCH_ACCOUNT(value);                ZimbraLog.security.info(ZimbraLog.encodeAttrs(                new String[] {"cmd", "DelegateAuth","accountId", account.getId()}));         Element response = lc.createElement(AdminService.DELEGATE_AUTH_RESPONSE);        long maxLifetime = account.getTimeInterval(Provisioning.A_zimbraAuthTokenLifetime, DEFAULT_AUTH_LIFETIME*1000);         // take the min of requested lifetime vs maxLifetime        long expires = System.currentTimeMillis()+ Math.min(lifetime, maxLifetime);        String token;        Account adminAcct = prov.get(AccountBy.ID, lc.getAuthtokenAccountId());        if (adminAcct == null)            throw AccountServiceException.NO_SUCH_ACCOUNT(lc.getAuthtokenAccountId());        AuthToken at = new AuthToken(account, expires, false, adminAcct);         try {            token = at.getEncoded();        } catch (AuthTokenException e) {            throw  ServiceException.FAILURE("unable to encode auth token", e);        }        response.addAttribute(AdminService.E_AUTH_TOKEN, token, Element.DISP_CONTENT);        response.addAttribute(AdminService.E_LIFETIME, lifetime, Element.DISP_CONTENT);		return response;	}