AuthToken at = new AuthToken(acct);
AuthToken at = new AuthToken(acct, true);
	public Element handle(Element request, Map<String, Object> context) throws ServiceException {        ZimbraSoapContext lc = getZimbraSoapContext(context);        String name = request.getAttribute(AdminService.E_NAME);		String password = request.getAttribute(AdminService.E_PASSWORD);		Provisioning prov = Provisioning.getInstance();		Account acct = null;        boolean isDomainAdmin = false;                Element virtualHostEl = request.getOptionalElement(AccountService.E_VIRTUAL_HOST);        String virtualHost = virtualHostEl == null ? null : virtualHostEl.getText().toLowerCase();         try {                        if (name.indexOf("@") == -1) {                acct = prov.get(AccountBy.adminName, name);                                if (acct == null) {                    if (virtualHost != null) {                        Domain d = prov.get(DomainBy.virtualHostname, virtualHost);                        if (d != null)                            name = name + "@" + d.getName();                    }                                    }             }            if (acct == null)                acct = prov.get(AccountBy.name, name);            if (acct == null)                throw AccountServiceException.AUTH_FAILED(name);                    ZimbraLog.security.info(ZimbraLog.encodeAttrs(                    new String[] {"cmd", "AdminAuth","account", name}));                     prov.authAccount(acct, password, "soap");                        isDomainAdmin = acct.getBooleanAttr(Provisioning.A_zimbraIsDomainAdminAccount, false);            boolean isAdmin= acct.getBooleanAttr(Provisioning.A_zimbraIsAdminAccount, false);                        boolean ok = (isDomainAdmin || isAdmin);            if (!ok)                     throw ServiceException.PERM_DENIED("not an admin account");        } catch (ServiceException se) {            ZimbraLog.security.warn(ZimbraLog.encodeAttrs(                    new String[] {"cmd", "AdminAuth","account", name, "error", se.getMessage()}));                throw se;        }        Element response = lc.createElement(AdminService.AUTH_RESPONSE);        String token;        AuthToken at = new AuthToken(acct);        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, at.getExpires() - System.currentTimeMillis(), Element.DISP_CONTENT);        response.addElement(AdminService.E_A).addAttribute(AdminService.A_N, Provisioning.A_zimbraIsDomainAdminAccount).setText(isDomainAdmin+"");        Session session = lc.getNewSession(acct.getId(), SessionCache.SESSION_ADMIN);        if (session != null)            ZimbraSoapContext.encodeSession(response, session, true);		return response;	}