if (context.basicAuthHappened && context.authTokenCookie == null) context.authTokenCookie = new AuthToken(context.authAccount).getEncoded();
if (context.basicAuthHappened && context.authTokenCookie == null) context.authTokenCookie = new AuthToken(context.authAccount, isAdminRequest(context)).getEncoded();
    private boolean isProxyRequest(HttpServletRequest req, HttpServletResponse resp, Context context) throws IOException, ServiceException {        // this should handle both explicit /user/user-on-other-server/ and        // /user/~/?id={account-id-on-other-server}:id                    if (!Provisioning.onLocalServer(context.targetAccount)) {            try {                if (context.basicAuthHappened && context.authTokenCookie == null)                     context.authTokenCookie = new AuthToken(context.authAccount).getEncoded();                Provisioning prov = Provisioning.getInstance();                                proxyServletRequest(req, resp, prov.getServer(context.targetAccount),                            context.basicAuthHappened ? context.authTokenCookie : null);                return true;            } catch (ServletException e) {                throw ServiceException.FAILURE("proxy error", e);            } catch (AuthTokenException e) {                throw ServiceException.FAILURE("proxy error", e);            }        }        return false;    }