Skip to content

Commit

Permalink
Adjusted logging in a few classes.
Browse files Browse the repository at this point in the history
Changed some System.err.println to logging statements.  Changed some
LOG.severe to LOG.info, since they are not fatal or even warn-level events.
  • Loading branch information
quux00 committed Oct 10, 2014
1 parent 6d6fe04 commit 7e7ea9e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.jivesoftware.authHelper.customescheme.negotiate;

//package com.sun.security.auth.callback;
package com.jivesoftware.authHelper.customescheme.negotiate;

/* JAAS imports */
import java.io.*;
import java.util.Arrays;
import java.util.logging.Logger;

import javax.security.auth.callback.*;


Expand All @@ -27,6 +29,9 @@

public class CustomNegotiateCallbackHandler implements CallbackHandler {

private static final Logger LOG = Logger.getLogger(CustomNegotiateCallbackHandler.class.getName());


private String username;
private String passswordstr;

Expand Down Expand Up @@ -82,7 +87,7 @@ public void handle(Callback[] callbacks)
text += message;
}
if (text != null) {
System.err.println(text);
LOG.info(text);
}

} else if (callbacks[i] instanceof NameCallback) {
Expand All @@ -108,14 +113,14 @@ public void handle(Callback[] callbacks)
} else if (callbacks[i] instanceof PasswordCallback) {
PasswordCallback pc = (PasswordCallback) callbacks[i];

System.err.print(pc.getPrompt());
System.err.flush();
LOG.info(pc.getPrompt());
// System.err.print(pc.getPrompt());
// System.err.flush();

// pc.setPassword(readPassword(System.in));

// passswordstr=System.getProperty("com.jivesoftware.spintegration.communication.krb5.password");


char[] pass = passswordstr.toCharArray();
pc.setPassword(pass);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private CustomConfiguration getCustomConfiguration(UsernamePasswordCredentials c
* @param server servername only (e.g: radar.it.su.se)
*/
protected void init(String server, UsernamePasswordCredentials credentials) throws GSSException {
LOG.severe("init " + server);
LOG.info("init " + server);

// Create a callback handler
Configuration.setConfiguration(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static void setKerberosCredentials(HttpClient httpClient,
logger.log(java.util.logging.Level.SEVERE, message, e);
}
try {
System.err.println("attempting to create KERBEROS using apache http client3");
logger.fine("attempting to create KERBEROS using apache http client3");
ArrayList schemes = new ArrayList();
schemes.add(NEGOTIATE);
schemes.add(AuthPolicy.BASIC); //to support basic auth proxy on the way
Expand Down

0 comments on commit 7e7ea9e

Please sign in to comment.