Reduce log verbosity
authorMathieu Baudier <mbaudier@argeo.org>
Tue, 21 Feb 2017 21:30:42 +0000 (22:30 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Tue, 21 Feb 2017 21:30:42 +0000 (22:30 +0100)
org.argeo.cms/src/org/argeo/cms/internal/http/client/SpnegoAuthScheme.java

index 7d5278ef06b90fb176c93ca35b582b8e18f41c55..c18e7ac24699cc9b9528028bb9ef981eefc630d8 100644 (file)
@@ -1,5 +1,6 @@
 package org.argeo.cms.internal.http.client;
 
+import java.net.URI;
 import java.net.URL;
 import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
@@ -44,10 +45,14 @@ public class SpnegoAuthScheme implements AuthScheme {
 
        private boolean complete = false;
        private String realm;
+       private String tokenStr;
 
        @Override
        public void processChallenge(String challenge) throws MalformedChallengeException {
-               log.debug("processChallenge " + challenge);
+//             if(tokenStr!=null){
+//                     log.error("Received challenge while there is a token. Failing.");
+//                     complete = false;
+//             }
 
        }
 
@@ -58,7 +63,6 @@ public class SpnegoAuthScheme implements AuthScheme {
 
        @Override
        public String getParameter(String name) {
-               log.debug("getParameter " + name);
                return null;
        }
 
@@ -79,19 +83,18 @@ public class SpnegoAuthScheme implements AuthScheme {
 
        @Override
        public boolean isComplete() {
-               log.debug("isComplete");
                return complete;
        }
 
        @Override
        public String authenticate(Credentials credentials, String method, String uri) throws AuthenticationException {
-               log.debug("authenticate " + method + " " + uri);
-               return null;
+//             log.debug("authenticate " + method + " " + uri);
+//             return null;
+               throw new UnsupportedOperationException();
        }
 
        @Override
        public String authenticate(Credentials credentials, HttpMethod method) throws AuthenticationException {
-               log.debug("authenticate " + method);
                GSSContext context = null;
                String tokenStr = null;
                String hostname;
@@ -126,9 +129,14 @@ public class SpnegoAuthScheme implements AuthScheme {
                        }
                        return "Negotiate " + tokenStr;
                } catch (GSSException e) {
+                       complete = true;
                        throw new AuthenticationException("Cannot authenticate to " + serverPrinc, e);
                }
        }
+       
+       private void doAuthenticate(URI uri){
+               
+       }
 
        public static void main(String[] args) {
                if (args.length == 0) {