Demos and Usage of org.apache.commons.httpclient.HttpStatus.HttpStatus.SC_UNAUTHORIZED


   1:                 request.getRequestLine().getHttpVersion(),
   2:                 HttpStatus.SC_UNAUTHORIZED);
   3:         if (!request.getRequestLine().getMethod().equalsIgnoreCase("HEAD")) {
   4:             response.setBodyString("unauthorized");
   5:         }

View Full Code Here
   1:             if (auth == null) { 
   2:                 response.setStatusLine(ver, HttpStatus.SC_UNAUTHORIZED);
   3:                 response.addHeader(new Header("WWW-Authenticate", "NTLM"));
   4:         ...
   5:                 if (authstr.equals("NTLM TlRMTVNTUAABAAAABlIAAAYABgAkAAAABAAEACAAAABIT1NURE9NQUlO")) {
   6:                     response.setStatusLine(ver, HttpStatus.SC_UNAUTHORIZED);
   7:                     response.addHeader(new Header("WWW-Authenticate", 
   8:         ...
   9:                 } else {
  10:                     response.setStatusLine(ver, HttpStatus.SC_UNAUTHORIZED);
  11:                     response.addHeader(new Header("WWW-Authenticate", "NTLM"));

View Full Code Here
   1:             if (auth == null) { 
   2:                 response.setStatusLine(ver, HttpStatus.SC_UNAUTHORIZED);
   3:                 response.addHeader(new Header("WWW-Authenticate", 
   4:         ...
   5:                 if (nonce.equals("ABC123")) {
   6:                     response.setStatusLine(ver, HttpStatus.SC_UNAUTHORIZED);
   7:                     response.addHeader(new Header("WWW-Authenticate", 
   8:                             "Digest realm=\"realm1\", nonce=\"321CBA\", stale=\"true\""));
   9:                     response.setBodyString("Authorization required");

View Full Code Here
   1:         switch (curi.getFetchStatus()) {
   2:         case HttpStatus.SC_UNAUTHORIZED:
   3:             boolean loaded = curi.hasRfc2617CredentialAvatar();
   4:             if (!loaded && logger.isLoggable(Level.INFO)) {
   5:                 logger.info("Have 401 but no creds loaded " + curi);

View Full Code Here
   1: 
   2:             case HttpStatus.SC_UNAUTHORIZED:
   3:                 boolean loaded = curi.hasRfc2617CredentialAvatar();
   4:                 if (!loaded) {
   5:                     logger.severe("Have 401 but no creds loaded " + curi);

View Full Code Here