BasicHttpContext localcontext = new BasicHttpContext();
// Generate DIGEST scheme object, initialize it and stick it to
// the local execution context
DigestScheme digestAuth = new DigestScheme();
// Suppose we already know the realm name
digestAuth.overrideParamter("realm", "some realm");
// Suppose we already know the expected nonce value
digestAuth.overrideParamter("nonce", "whatever");
localcontext.setAttribute("preemptive-auth", digestAuth);
// Add as the first request interceptor