From f33278929da2a15c01611c52885d285ec7dd8775 Mon Sep 17 00:00:00 2001 From: Juan Carlos Luciani Date: Wed, 21 Feb 2007 18:08:09 +0000 Subject: [PATCH] Continuation of changes to switch over to using log4j. --- .../server-java/Jaas/linux/Makefile.am | 2 +- .../com/novell/casa/jaas/CasaLoginModule.java | 17 +++--- .../server-java/Svc/linux/Makefile.am | 1 + .../server-java/Svc/linux/log4j.properties | 26 ++++----- .../casa/authtoksvc/AuthMechConfig.java | 28 ++++----- .../casa/authtoksvc/AuthTokenConfig.java | 32 +++++----- .../novell/casa/authtoksvc/Authenticate.java | 52 ++++++++--------- .../casa/authtoksvc/EnabledSvcsConfig.java | 8 +-- .../casa/authtoksvc/IdenTokenConfig.java | 10 ++-- .../com/novell/casa/authtoksvc/SvcConfig.java | 48 +++++++-------- .../package/linux/CASA_auth_token_svc.spec.in | 3 +- .../linux/CASA_auth_token_svc_4zen.spec.in | 58 +++++++++---------- 12 files changed, 143 insertions(+), 142 deletions(-) diff --git a/CASA-auth-token/server-java/Jaas/linux/Makefile.am b/CASA-auth-token/server-java/Jaas/linux/Makefile.am index c6889282..a7ac6ac8 100644 --- a/CASA-auth-token/server-java/Jaas/linux/Makefile.am +++ b/CASA-auth-token/server-java/Jaas/linux/Makefile.am @@ -47,7 +47,7 @@ BUILDDIR = ../build CLASSES = $(addprefix $(BUILDDIR)/, $(JAVAFILES:%.java=%.class)) -LIBS = +LIBS = :/usr/share/java/log4j.jar CLASSPATH = $(LIBDIR)/java/CasaAuthToken.jar:$(LIBS) all: $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) diff --git a/CASA-auth-token/server-java/Jaas/src/com/novell/casa/jaas/CasaLoginModule.java b/CASA-auth-token/server-java/Jaas/src/com/novell/casa/jaas/CasaLoginModule.java index 2a51d223..6297f00f 100644 --- a/CASA-auth-token/server-java/Jaas/src/com/novell/casa/jaas/CasaLoginModule.java +++ b/CASA-auth-token/server-java/Jaas/src/com/novell/casa/jaas/CasaLoginModule.java @@ -27,6 +27,8 @@ package com.novell.casa.jaas; import java.util.Map; import java.util.Set; +import org.apache.log4j.Logger; + import javax.security.auth.Subject; import javax.security.auth.callback.Callback; import javax.security.auth.callback.CallbackHandler; @@ -49,6 +51,8 @@ import com.novell.casa.authtoksvc.CasaIdentityToken; */ public final class CasaLoginModule implements LoginModule { + private static final Logger m_log = Logger.getLogger(CasaLoginModule.class); + private final static String casaUsername = "CasaIdentityUser"; private Subject m_subject = null; @@ -96,7 +100,7 @@ public final class CasaLoginModule implements LoginModule } catch (Exception e) { - System.err.println("CasaLoginModule.commit()- Exception caught associating principal, msg: " + e.getMessage()); + m_log.error("CasaLoginModule.commit()- Exception caught associating principal, msg: " + e.getMessage()); throw new LoginException("Error encountered"); } } @@ -119,7 +123,7 @@ public final class CasaLoginModule implements LoginModule // Verify that a CallbackHandler was specified if (m_callbackHandler == null) { - System.err.println("CasaLoginModule.login()- Null CallbackHandler"); + m_log.error("CasaLoginModule.login()- Null CallbackHandler"); throw new LoginException("Null CallbackHandler"); } @@ -153,7 +157,7 @@ public final class CasaLoginModule implements LoginModule } catch (Exception e) { - System.err.println("CasaLoginModule.login()- Exception caught during nameCallback, msg: " + e.getMessage()); + m_log.warn("CasaLoginModule.login()- Exception caught during nameCallback, msg: " + e.getMessage()); } // Check the username @@ -187,7 +191,7 @@ public final class CasaLoginModule implements LoginModule } catch (Exception e) { - System.err.println("CasaLoginModule.login()- Exception caught during passwordCallback, msg: " + e.getMessage()); + m_log.warn("CasaLoginModule.login()- Exception caught during passwordCallback, msg: " + e.getMessage()); } // Check the CasaAuthenticationToken @@ -209,15 +213,14 @@ public final class CasaLoginModule implements LoginModule catch (Exception e) { // The validation of one of the tokens failed - // tbd - Log - System.err.println("CasaLoginModule.login()- Exception caught during token processing, msg: " + e.getMessage()); + m_log.info("CasaLoginModule.login()- Exception caught during token processing, msg: " + e.getMessage()); throw new FailedLoginException("Token validation failed"); } } else { // Token not provided - System.err.println("CasaLoginModule.login()- Token not provided"); + m_log.warn("CasaLoginModule.login()- Token not provided"); throw new FailedLoginException("CasaAuthenticationToken not obtained"); } diff --git a/CASA-auth-token/server-java/Svc/linux/Makefile.am b/CASA-auth-token/server-java/Svc/linux/Makefile.am index 5ec857f5..fd2e7ac7 100644 --- a/CASA-auth-token/server-java/Svc/linux/Makefile.am +++ b/CASA-auth-token/server-java/Svc/linux/Makefile.am @@ -156,6 +156,7 @@ $(BUILDDIR)/$(WEBAPP): $(BUILDDIR) $(CLASSES) cp ../src/com/novell/casa/authtoksvc/Pwd_mechanism.settings $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms/PwdAuthenticate/mechanism.settings cp $(AXIS_JARS_DIR)/*.jar $(BUILDDIR)/webapp/WEB-INF/lib/ rm $(BUILDDIR)/webapp/WEB-INF/lib/xercesImpl.jar + rm $(BUILDDIR)/webapp/WEB-INF/lib/log4j-1.2.8.jar ls $(BUILDDIR)/webapp/WEB-INF/lib/ jar cvf $(BUILDDIR)/$(WEBAPP) -C $(BUILDDIR)/webapp . cp $(BUILDDIR)/$(WEBAPP) $(LIBDIR)/java/ diff --git a/CASA-auth-token/server-java/Svc/linux/log4j.properties b/CASA-auth-token/server-java/Svc/linux/log4j.properties index 40e79821..7c574185 100644 --- a/CASA-auth-token/server-java/Svc/linux/log4j.properties +++ b/CASA-auth-token/server-java/Svc/linux/log4j.properties @@ -4,17 +4,17 @@ # ######################################################## -# -# Root logger configuration. -# -log4j.rootLogger=debug, DefaultAppender - -# -# DefaultAppender configuration. -# -log4j.appender.DefaultAppender=org.apache.log4j.RollingFileAppender -log4j.appender.DefaultAppender.File=/srv/www/casaats/logs/ats.log -log4j.appender.DefaultAppender.MaxFileSize=100KB +# +# Root logger configuration. +# +log4j.rootLogger=info, DefaultAppender + +# +# DefaultAppender configuration. +# +log4j.appender.DefaultAppender=org.apache.log4j.RollingFileAppender +log4j.appender.DefaultAppender.File=/srv/www/casaats/logs/ats.log +log4j.appender.DefaultAppender.MaxFileSize=100KB log4j.appender.DefaultAppender.MaxBackupIndex=2 -log4j.appender.DefaultAppender.layout=org.apache.log4j.PatternLayout -log4j.appender.DefaultAppender.layout.ConversionPattern=%d{ISO8601} %p %C{2} %m%n +log4j.appender.DefaultAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.DefaultAppender.layout.ConversionPattern=%d{ISO8601} %p %C{2} %m%n diff --git a/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/AuthMechConfig.java b/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/AuthMechConfig.java index f9849ab9..eea49f9c 100644 --- a/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/AuthMechConfig.java +++ b/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/AuthMechConfig.java @@ -59,7 +59,7 @@ public final class AuthMechConfig */ public AuthMechConfig() { - m_log.debug("AuthMechConfig()- Default"); + m_log.debug("Constructor- Default"); // Create a map to keep track of the token settings m_mechSettingsMap = new HashMap(); @@ -73,7 +73,7 @@ public final class AuthMechConfig */ public AuthMechConfig(String mechSettingsFileName) throws Exception { - m_log.debug("AuthMechConfig()-"); + m_log.debug("Constructor-"); // Create a map to keep track of the token settings m_mechSettingsMap = new HashMap(); @@ -96,23 +96,23 @@ public final class AuthMechConfig } catch (SAXException e) { - m_log.warn("AuthMechConfig()- " + mechSettingsFileName + " format error, exception: " + e.toString()); - throw new Exception("AuthMechConfig()- authtoken.settings format error", e); + m_log.warn("Constructor- " + mechSettingsFileName + " format error, exception: " + e.toString()); + throw new Exception("Constructor- authtoken.settings format error", e); } catch (SecurityException e) { - m_log.warn("AuthMechConfig()- SecurityException accessing " + mechSettingsFileName + " Exception=" + e.toString()); - throw new Exception("AuthMechConfig()- Not able to access file", e); + m_log.warn("Constructor- SecurityException accessing " + mechSettingsFileName + " Exception=" + e.toString()); + throw new Exception("Constructor- Not able to access file", e); } catch (FileNotFoundException e) { - m_log.warn("AuthMechConfig()- File " + mechSettingsFileName + " not found"); - throw new Exception("AuthMechConfig()- File not found", e); + m_log.warn("Constructor- File " + mechSettingsFileName + " not found"); + throw new Exception("Constructor- File not found", e); } catch (IOException e) { - m_log.warn("AuthMechConfig()- IOException accessing " + mechSettingsFileName + " Exception=" + e.toString()); - throw new Exception("AuthMechConfig()- Read error", e); + m_log.warn("Constructor- IOException accessing " + mechSettingsFileName + " Exception=" + e.toString()); + throw new Exception("Constructor- Read error", e); } finally { @@ -143,14 +143,14 @@ public final class AuthMechConfig if (value == null) { - m_log.info("AuthMechConfig.getSetting()- Did not find setting " + settingName); + m_log.debug("getSetting()- Did not find setting " + settingName); // The setting is not in our map, check if it is one to // which we have defaults. if (settingName.equals(Krb5ServicePrincipalName)) { value = m_defaultKrb5ServicePrincipalNameValue; - m_log.info("AuthMechConfig.getSetting()- Assigning default value " + value); + m_log.debug("getSetting()- Assigning default value " + value); // Add the key to the map so that it can be found quicker next time m_mechSettingsMap.put(Krb5ServicePrincipalName, m_defaultKrb5ServicePrincipalNameValue); @@ -158,8 +158,8 @@ public final class AuthMechConfig } else { - m_log.info("AuthMechConfig.getSetting()- Found setting " + settingName); - m_log.info("AuthMechConfig.getSetting()- Setting value = " + value); + m_log.debug("getSetting()- Found setting " + settingName); + m_log.debug("getSetting()- Setting value = " + value); } return value; diff --git a/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/AuthTokenConfig.java b/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/AuthTokenConfig.java index 869c0199..3ad3debc 100644 --- a/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/AuthTokenConfig.java +++ b/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/AuthTokenConfig.java @@ -112,8 +112,8 @@ public final class AuthTokenConfig tokenLifetime = Integer.valueOf(getSetting(TokenLifetime)).intValue(); if (tokenLifetime < m_minimumTokenLifetimeValue) { - m_log.info("AuthTokenConfig()- Configured token lifetime too small, defaulting to " - + Integer.toString(m_minimumTokenLifetimeValue) + " seconds"); + m_log.debug("AuthTokenConfig()- Configured token lifetime too small, defaulting to " + + Integer.toString(m_minimumTokenLifetimeValue) + " seconds"); tokenLifetime = m_minimumTokenLifetimeValue; // Update the map with the new value for the setting @@ -122,8 +122,8 @@ public final class AuthTokenConfig } catch (NumberFormatException e) { - m_log.info("AuthTokenConfig()- Invalid configured token lifetime value, defaulting to " - + Integer.toString(m_minimumTokenLifetimeValue) + " seconds"); + m_log.debug("AuthTokenConfig()- Invalid configured token lifetime value, defaulting to " + + Integer.toString(m_minimumTokenLifetimeValue) + " seconds"); tokenLifetime = m_minimumTokenLifetimeValue; // Update the map with the new value for the setting @@ -136,8 +136,8 @@ public final class AuthTokenConfig lifetimeShorter = Integer.valueOf(getSetting(LifetimeShorter)).intValue(); if (lifetimeShorter < m_minimumLifetimeShorterValue) { - m_log.info("AuthTokenConfig()- Configured lifetime shorter too small, defaulting to " - + Integer.toString(m_minimumLifetimeShorterValue) + " seconds"); + m_log.debug("AuthTokenConfig()- Configured lifetime shorter too small, defaulting to " + + Integer.toString(m_minimumLifetimeShorterValue) + " seconds"); lifetimeShorter = m_minimumLifetimeShorterValue; // Update the map with the new value for the setting @@ -146,8 +146,8 @@ public final class AuthTokenConfig } catch (NumberFormatException e) { - m_log.info("AuthTokenConfig()- Invalid configured lifetime shorter value, defaulting to " - + Integer.toString(m_minimumLifetimeShorterValue) + " seconds"); + m_log.debug("AuthTokenConfig()- Invalid configured lifetime shorter value, defaulting to " + + Integer.toString(m_minimumLifetimeShorterValue) + " seconds"); lifetimeShorter = m_minimumLifetimeShorterValue; // Update the map with the new value for the setting @@ -157,8 +157,8 @@ public final class AuthTokenConfig if (lifetimeShorter > tokenLifetime || (tokenLifetime - lifetimeShorter) < m_minimumLifetimeShorterDifferential) { - m_log.info("AuthTokenConfig()- Invalid lifetime shorter value, defaulting to " - + Integer.toString(m_minimumLifetimeShorterValue) + " seconds"); + m_log.debug("AuthTokenConfig()- Invalid lifetime shorter value, defaulting to " + + Integer.toString(m_minimumLifetimeShorterValue) + " seconds"); // Update the map with the new value for the setting m_tokenSettingsMap.put(LifetimeShorter, Integer.toString(m_minimumLifetimeShorterValue)); @@ -212,14 +212,14 @@ public final class AuthTokenConfig String value = m_tokenSettingsMap.get(settingName); if (value == null) { - m_log.info("AuthTokenConfig.getSetting()- Did not find setting " + settingName); + m_log.debug("AuthTokenConfig.getSetting()- Did not find setting " + settingName); // The setting is not in our map, check if it is one to // which we have defaults. if (settingName.equalsIgnoreCase(TokenLifetime)) { value = m_defaultTokenLifetimeValue; - m_log.info("AuthTokenConfig.getSetting()- Assigning default value " + value); + m_log.debug("AuthTokenConfig.getSetting()- Assigning default value " + value); // Add the key to the map so that it can be found quicker next time m_tokenSettingsMap.put(TokenLifetime, m_defaultTokenLifetimeValue); @@ -227,7 +227,7 @@ public final class AuthTokenConfig else if (settingName.equalsIgnoreCase(LifetimeShorter)) { value = m_defaultLifetimeShorterValue; - m_log.info("AuthTokenConfig.getSetting()- Assigning default value " + value); + m_log.debug("AuthTokenConfig.getSetting()- Assigning default value " + value); // Add the key to the map so that it can be found quicker next time m_tokenSettingsMap.put(LifetimeShorter, m_defaultLifetimeShorterValue); @@ -235,7 +235,7 @@ public final class AuthTokenConfig else if (settingName.equalsIgnoreCase(IdentityTokenType)) { value = m_defaultLifetimeShorterValue; - m_log.info("AuthTokenConfig.getSetting()- Assigning default value " + value); + m_log.debug("AuthTokenConfig.getSetting()- Assigning default value " + value); // Add the key to the map so that it can be found quicker next time m_tokenSettingsMap.put(IdentityTokenType, m_defaultIdentityTokenTypeValue); @@ -243,8 +243,8 @@ public final class AuthTokenConfig } else { - m_log.info("AuthTokenConfig.getSetting()- Found setting " + settingName); - m_log.info("AuthTokenConfig.getSetting()- Setting value = " + value); + m_log.debug("AuthTokenConfig.getSetting()- Found setting " + settingName); + m_log.debug("AuthTokenConfig.getSetting()- Setting value = " + value); } return value; diff --git a/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/Authenticate.java b/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/Authenticate.java index 55272fa4..b4efefd3 100644 --- a/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/Authenticate.java +++ b/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/Authenticate.java @@ -101,7 +101,7 @@ public final class Authenticate implements RpcMethod { if (mechanismFolder.isDirectory()) { - m_log.debug("Authenticate.init()- Mechanism folder " + mechanismFolder + " is directory"); + m_log.debug("init()- Mechanism folder " + mechanismFolder + " is directory"); // Try to obtain the mechanism settings try @@ -123,7 +123,7 @@ public final class Authenticate implements RpcMethod // ultimately instantiate objects from a class loaded by the same class loader that // loads the AuthMechanism class to avoid ClassCastExceptions. File mechClassPathFile = new File(svcConfig.getSetting(SvcConfig.AppRootPath) + relativePath); - m_log.debug("Authenticate.init()- Mechanism path = " + mechClassPathFile); + m_log.debug("init()- Mechanism path = " + mechClassPathFile); try { URL methClassPathUrl = mechClassPathFile.toURL(); @@ -149,19 +149,19 @@ public final class Authenticate implements RpcMethod } catch (MalformedURLException e) { - m_log.warn("Authenticate.init()- MalformedURLException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); + m_log.warn("init()- MalformedURLException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); } catch (ClassNotFoundException e) { - m_log.warn("Authenticate.init()- ClassNotFoundException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); + m_log.warn("init()- ClassNotFoundException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); } catch (InstantiationException e) { - m_log.warn("Authenticate.init()- InstantiationException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); + m_log.warn("init()- InstantiationException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); } catch (IllegalAccessException e) { - m_log.warn("Authenticate.init()- IllegalAccessException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); + m_log.warn("init()- IllegalAccessException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); } } else @@ -174,7 +174,7 @@ public final class Authenticate implements RpcMethod // ultimately instantiate objects from a class loaded by the same class loader that // loads the AuthMechanism class to avoid ClassCastExceptions. File mechClassPathFile = new File(classPath); - m_log.debug("Authenticate.init()- Mechanism path = " + mechClassPathFile); + m_log.debug("init()- Mechanism path = " + mechClassPathFile); try { URL methClassPathUrl = mechClassPathFile.toURL(); @@ -199,53 +199,53 @@ public final class Authenticate implements RpcMethod } catch (MalformedURLException e) { - m_log.warn("Authenticate.init()- MalformedURLException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); + m_log.warn("init()- MalformedURLException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); } catch (ClassNotFoundException e) { - m_log.warn("Authenticate.init()- ClassNotFoundException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); + m_log.warn("init()- ClassNotFoundException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); } catch (InstantiationException e) { - m_log.warn("Authenticate.init()- InstantiationException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); + m_log.warn("init()- InstantiationException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); } catch (IllegalAccessException e) { - m_log.warn("Authenticate.init()- IllegalAccessException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); + m_log.warn("init()- IllegalAccessException for " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); } } else { - m_log.warn("Authenticate.init()- No configuration to find class path to load " + mechanismFolder + File.separator + m_mechanismSettingsFileName); + m_log.warn("init()- No configuration to find class path to load " + mechanismFolder + File.separator + m_mechanismSettingsFileName); } } } else { - m_log.warn("Authenticate.init()- No configured mechanism class name for " + mechanismFolder + File.separator + m_mechanismSettingsFileName); + m_log.warn("init()- No configured mechanism class name for " + mechanismFolder + File.separator + m_mechanismSettingsFileName); } } catch (SecurityException e) { - m_log.warn("Authenticate.init()- SecurityException accessing " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); + m_log.warn("init()- SecurityException accessing " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); } catch (FileNotFoundException e) { - m_log.warn("Authenticate.init()- No authentication policy file for " + mechanismFolder); + m_log.warn("init()- No authentication policy file for " + mechanismFolder); } catch (IOException e) { - m_log.warn("Authenticate.init()- IOException reading " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); + m_log.warn("init()- IOException reading " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); } catch (Exception e) { - m_log.warn("Authenticate.init()- Exception instantiating mechConfig or mechanism " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); + m_log.warn("init()- Exception instantiating mechConfig or mechanism " + mechanismFolder + File.separator + m_mechanismSettingsFileName + " Exception=" + e.toString()); } } } catch (SecurityException e) { - m_log.warn("Authenticate.init()- SecurityException accessing " + mechanismFolder + " Exception=" + e.toString()); + m_log.warn("init()- SecurityException accessing " + mechanismFolder + " Exception=" + e.toString()); } finally { @@ -300,12 +300,12 @@ public final class Authenticate implements RpcMethod } else { - m_log.warn("Authenticate.init()- Unable to obtain mechanisms folder " + mechanismsConfigFolder + " objects"); + m_log.warn("init()- Unable to obtain mechanisms folder " + mechanismsConfigFolder + " objects"); } } catch (SecurityException e) { - m_log.warn("Authenticate.init()- SecurityException accessing " + mechanismsConfigFolder + " Exception=" + e.toString()); + m_log.warn("init()- SecurityException accessing " + mechanismsConfigFolder + " Exception=" + e.toString()); } } @@ -321,7 +321,7 @@ public final class Authenticate implements RpcMethod try { - m_log.debug("Authenticate.invoke()"); + m_log.debug("invoke()"); // Parse the AuthReqMsg sent from the client authReqMsg = new AuthReqMsg(inStream); @@ -336,7 +336,7 @@ public final class Authenticate implements RpcMethod // Create response based on the identity resolution results if (identId != null && identId.length() != 0) { - m_log.info("Authenticate.invoke()- identId resolved, " + identId); + m_log.info("invoke()- identId resolved, " + identId); // An identity was resolved, get a SessionToken for it. SessionToken sessionToken = new SessionToken(identId, @@ -355,7 +355,7 @@ public final class Authenticate implements RpcMethod } else { - m_log.info("Authenticate.invoke()- identId not resolved"); + m_log.info("invoke()- identId not resolved"); // Write out the response AuthRespMsg authRespMsg = new AuthRespMsg(ProtoDefs.httpUnauthorizedStatusMsg, @@ -365,7 +365,7 @@ public final class Authenticate implements RpcMethod } else { - m_log.warn("Authenticate.invoke()- Unsupported mechanism " + authReqMsg.getMechanismId()); + m_log.warn("invoke()- Unsupported mechanism " + authReqMsg.getMechanismId()); // Write out the response AuthRespMsg authRespMsg = new AuthRespMsg(ProtoDefs.httpNotFoundStatusMsg, @@ -375,7 +375,7 @@ public final class Authenticate implements RpcMethod } catch (Exception e) { - m_log.error("Authenticate.invoke()- Exception: " + e.toString()); + m_log.error("invoke()- Exception: " + e.toString()); // Write out the response try @@ -386,7 +386,7 @@ public final class Authenticate implements RpcMethod } catch (Exception e2) { - m_log.error("Authenticate.invoke()- Exception trying to construct response msg: " + e2.toString()); + m_log.error("invoke()- Exception trying to construct response msg: " + e2.toString()); } } finally diff --git a/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/EnabledSvcsConfig.java b/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/EnabledSvcsConfig.java index 6e752082..708b9004 100644 --- a/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/EnabledSvcsConfig.java +++ b/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/EnabledSvcsConfig.java @@ -96,7 +96,7 @@ public final class EnabledSvcsConfig boolean enabledSvcsOnly) throws Exception { m_log.debug("EnabledSvcsConfig()-"); - m_log.info("EnabledSvcsConfig()- SvcConfigPath = " + svcConfigPath); + m_log.debug("EnabledSvcsConfig()- SvcConfigPath = " + svcConfigPath); // Remember the enabledSvcsOnly setting m_enabledSvcsOnly = enabledSvcsOnly; @@ -204,7 +204,7 @@ public final class EnabledSvcsConfig { // Check if we are dealing with a file or a folder File serviceFolder = new File(hostFolder, hostFolderObjs[ii]); - m_log.info("EnabledSvcsConfig()- Service folder " + serviceFolder); + m_log.debug("EnabledSvcsConfig()- Service folder " + serviceFolder); try { if (serviceFolder.isDirectory()) @@ -285,7 +285,7 @@ public final class EnabledSvcsConfig (idenTokenConfig != null) ? idenTokenConfig : m_defaultIdenTokenConfig); // Add this entry to our map - m_log.info("EnabledSvcsConfig()- Adding entry in map for " + servicesConfigFolderObjs[i] + " " + hostFolderObjs[ii]); + m_log.debug("EnabledSvcsConfig()- Adding entry in map for " + servicesConfigFolderObjs[i] + " " + hostFolderObjs[ii]); enabledSvcsConfigMap.put(hostFolderObjs[ii], svcConfigEntry); } else @@ -305,7 +305,7 @@ public final class EnabledSvcsConfig } else { - m_log.info("EnabledSvcsConfig()- No services configured for " + hostFolder); + m_log.debug("EnabledSvcsConfig()- No services configured for " + hostFolder); } } } diff --git a/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/IdenTokenConfig.java b/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/IdenTokenConfig.java index 602553f5..7565fa2b 100644 --- a/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/IdenTokenConfig.java +++ b/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/IdenTokenConfig.java @@ -100,7 +100,7 @@ public final class IdenTokenConfig // Process the specified attributes if (m_tokenSettingsMap.containsKey(Attributes) == false) { - m_log.info("IdenTokenConfig()- Attributes not configured, defaulting them."); + m_log.debug("IdenTokenConfig()- Attributes not configured, defaulting them."); m_tokenSettingsMap.put(Attributes, m_defaultAttributesValue); } String attributes = m_tokenSettingsMap.get(Attributes); @@ -154,14 +154,14 @@ public final class IdenTokenConfig String value = m_tokenSettingsMap.get(settingName); if (value == null) { - m_log.info("IdenTokenConfig.getSetting()- Did not find setting " + settingName); + m_log.debug("IdenTokenConfig.getSetting()- Did not find setting " + settingName); // The setting is not in our map, check if it is one to // which we have defaults. if (settingName.equalsIgnoreCase(EncryptAttributes)) { value = m_defaultEncryptAttributesValue; - m_log.info("AuthTokenConfig.getSetting()- Assigning default value " + value); + m_log.debug("AuthTokenConfig.getSetting()- Assigning default value " + value); // Add the key to the map so that it can be found quicker next time m_tokenSettingsMap.put(EncryptAttributes, m_defaultEncryptAttributesValue); @@ -169,8 +169,8 @@ public final class IdenTokenConfig } else { - m_log.info("IdenTokenConfig.getSetting()- Found setting " + settingName); - m_log.info("IdenTokenConfig.getSetting()- Setting value = " + value); + m_log.debug("IdenTokenConfig.getSetting()- Found setting " + settingName); + m_log.debug("IdenTokenConfig.getSetting()- Setting value = " + value); } return value; diff --git a/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/SvcConfig.java b/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/SvcConfig.java index 73e4c05b..9ba3b838 100644 --- a/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/SvcConfig.java +++ b/CASA-auth-token/server-java/Svc/src/com/novell/casa/authtoksvc/SvcConfig.java @@ -90,7 +90,7 @@ public final class SvcConfig { m_log.debug("SvcConfig()-"); - m_log.info("SvcConfig()- SvcConfigPath = " + svcConfigPath); + m_log.debug("SvcConfig()- SvcConfigPath = " + svcConfigPath); // Create a map to keep track of the service settings m_svcSettingsMap = new HashMap(); @@ -122,8 +122,8 @@ public final class SvcConfig tokenLifetime = Integer.valueOf(getSetting(SessionTokenLifetime)).intValue(); if (tokenLifetime < MinimumTokenLifetimeValue) { - m_log.info("SvcConfig()- Configured token lifetime too small, defaulting to " - + Integer.toString(MinimumTokenLifetimeValue) + " seconds"); + m_log.debug("SvcConfig()- Configured token lifetime too small, defaulting to " + + Integer.toString(MinimumTokenLifetimeValue) + " seconds"); tokenLifetime = MinimumTokenLifetimeValue; // Update the map with the new value for the setting @@ -132,8 +132,8 @@ public final class SvcConfig } catch (NumberFormatException e) { - m_log.info("SvcConfig()- Invalid configured token lifetime value, defaulting to " - + Integer.toString(MinimumTokenLifetimeValue) + " seconds"); + m_log.debug("SvcConfig()- Invalid configured token lifetime value, defaulting to " + + Integer.toString(MinimumTokenLifetimeValue) + " seconds"); tokenLifetime = MinimumTokenLifetimeValue; // Update the map with the new value for the setting @@ -146,8 +146,8 @@ public final class SvcConfig lifetimeShorter = Integer.valueOf(getSetting(LifetimeShorter)).intValue(); if (lifetimeShorter < MinimumLifetimeShorterValue) { - m_log.info("SvcConfig()- Configured lifetime shorter too small, defaulting to " - + Integer.toString(MinimumLifetimeShorterValue) + " seconds"); + m_log.debug("SvcConfig()- Configured lifetime shorter too small, defaulting to " + + Integer.toString(MinimumLifetimeShorterValue) + " seconds"); lifetimeShorter = MinimumLifetimeShorterValue; // Update the map with the new value for the setting @@ -156,8 +156,8 @@ public final class SvcConfig } catch (NumberFormatException e) { - m_log.info("SvcConfig()- Invalid configured lifetime shorter value, defaulting to " - + Integer.toString(MinimumLifetimeShorterValue) + " seconds"); + m_log.debug("SvcConfig()- Invalid configured lifetime shorter value, defaulting to " + + Integer.toString(MinimumLifetimeShorterValue) + " seconds"); lifetimeShorter = MinimumLifetimeShorterValue; // Update the map with the new value for the setting @@ -167,8 +167,8 @@ public final class SvcConfig if (lifetimeShorter > tokenLifetime || (tokenLifetime - lifetimeShorter) < MinimumLifetimeShorterDifferential) { - m_log.info("SvcConfig()- Invalid lifetime shorter value, defaulting to " - + Integer.toString(MinimumLifetimeShorterValue) + " seconds"); + m_log.debug("SvcConfig()- Invalid lifetime shorter value, defaulting to " + + Integer.toString(MinimumLifetimeShorterValue) + " seconds"); // Update the map with the new value for the setting m_svcSettingsMap.put(LifetimeShorter, Integer.toString(MinimumLifetimeShorterValue)); @@ -181,8 +181,8 @@ public final class SvcConfig if (reconfigureInterval != 0 && reconfigureInterval < MinimumReconfigureIntervalValue) { - m_log.info("SvcConfig()- Configured reconfigure interval too small, defaulting to " - + Integer.toString(MinimumReconfigureIntervalValue) + " seconds"); + m_log.debug("SvcConfig()- Configured reconfigure interval too small, defaulting to " + + Integer.toString(MinimumReconfigureIntervalValue) + " seconds"); // Update the map with the new value for the setting m_svcSettingsMap.put(ReconfigureInterval, Integer.toString(MinimumReconfigureIntervalValue)); @@ -190,8 +190,8 @@ public final class SvcConfig } catch (NumberFormatException e) { - m_log.info("SvcConfig()- Invalid configured reconfigured interval value, defaulting to " - + Integer.toString(MinimumReconfigureIntervalValue) + " seconds"); + m_log.debug("SvcConfig()- Invalid configured reconfigured interval value, defaulting to " + + Integer.toString(MinimumReconfigureIntervalValue) + " seconds"); // Update the map with the new value for the setting m_svcSettingsMap.put(ReconfigureInterval, Integer.toString(MinimumReconfigureIntervalValue)); @@ -249,14 +249,14 @@ public final class SvcConfig String value = m_svcSettingsMap.get(settingName); if (value == null) { - m_log.info("SvcConfig.getSetting()- Did not find setting " + settingName); + m_log.debug("SvcConfig.getSetting()- Did not find setting " + settingName); // The setting is not in our map, check if it is one to // which we have defaults. if (settingName.equalsIgnoreCase(SessionTokenLifetime)) { value = DefaultSessionTokenLifetimeValue; - m_log.info("SvcConfig.getSetting()- Assigning default value " + value); + m_log.debug("SvcConfig.getSetting()- Assigning default value " + value); // Add the key to the map so that it can be found quicker next time m_svcSettingsMap.put(SessionTokenLifetime, DefaultSessionTokenLifetimeValue); @@ -264,7 +264,7 @@ public final class SvcConfig else if (settingName.equalsIgnoreCase(LifetimeShorter)) { value = DefaultLifetimeShorterValue; - m_log.info("SvcConfig.getSetting()- Assigning default value " + value); + m_log.debug("SvcConfig.getSetting()- Assigning default value " + value); // Add the key to the map so that it can be found quicker next time m_svcSettingsMap.put(LifetimeShorter, DefaultLifetimeShorterValue); @@ -272,7 +272,7 @@ public final class SvcConfig else if (settingName.equalsIgnoreCase(ReconfigureInterval)) { value = DefaultReconfigureIntervalValue; - m_log.info("SvcConfig.getSetting()- Assigning default value " + value); + m_log.debug("SvcConfig.getSetting()- Assigning default value " + value); // Add the key to the map so that it can be found quicker next time m_svcSettingsMap.put(ReconfigureInterval, DefaultReconfigureIntervalValue); @@ -280,7 +280,7 @@ public final class SvcConfig else if (settingName.equalsIgnoreCase(SigningKeyAliasName)) { value = DefaultSigningKeyAliasNameValue; - m_log.info("SvcConfig.getSetting()- Assigning default value " + value); + m_log.debug("SvcConfig.getSetting()- Assigning default value " + value); // Add the key to the map so that it can be found quicker next time m_svcSettingsMap.put(SigningKeyAliasName, DefaultSigningKeyAliasNameValue); @@ -288,21 +288,21 @@ public final class SvcConfig else if (settingName.equalsIgnoreCase(SigningKeyPassword)) { value = DefaultSigningKeyPasswordValue; - m_log.info("SvcConfig.getSetting()- Assigning default value " + value); + m_log.debug("SvcConfig.getSetting()- Assigning default value " + value); // Add the key to the map so that it can be found quicker next time m_svcSettingsMap.put(SigningKeyPassword, DefaultSigningKeyPasswordValue); } else if (settingName.equalsIgnoreCase(IdentityAbstractionConfigFile)) { - m_log.info("SvcConfig.getSetting()- Mandatory setting " + IdentityAbstractionConfigFile + " not set"); + m_log.debug("SvcConfig.getSetting()- Mandatory setting " + IdentityAbstractionConfigFile + " not set"); throw new Exception("Missing mandatory configuration setting"); } } else { - m_log.info("SvcConfig.getSetting()- Found setting " + settingName); - m_log.info("SvcConfig.getSetting()- Setting value = " + value); + m_log.debug("SvcConfig.getSetting()- Found setting " + settingName); + m_log.debug("SvcConfig.getSetting()- Setting value = " + value); } return value; diff --git a/CASA-auth-token/server-java/package/linux/CASA_auth_token_svc.spec.in b/CASA-auth-token/server-java/package/linux/CASA_auth_token_svc.spec.in index 27ad2e56..44061d05 100644 --- a/CASA-auth-token/server-java/package/linux/CASA_auth_token_svc.spec.in +++ b/CASA-auth-token/server-java/package/linux/CASA_auth_token_svc.spec.in @@ -56,6 +56,7 @@ services that are CASA authentication enabled. Summary: Novell CASA Authentication Token JAAS Support Components Group: Applications/System Requires: jre >= 1.5.0 +Requires: log4j %description -n CASA_auth_token_jaas_support CASA_auth_token is an authentication token infrastructure with support for @@ -241,8 +242,6 @@ fi %stop_on_removal casa_atsd %postun -%stop_on_update casa_atsd - # Always undeploy our webapp to force re-deployment on upgrade cases echo "Cleaning up webapp folders" rm -drf /srv/www/casaats/webapps/CasaAuthTokenSvc diff --git a/CASA-auth-token/server-java/package/linux/CASA_auth_token_svc_4zen.spec.in b/CASA-auth-token/server-java/package/linux/CASA_auth_token_svc_4zen.spec.in index dd570ee9..ab0e1c02 100644 --- a/CASA-auth-token/server-java/package/linux/CASA_auth_token_svc_4zen.spec.in +++ b/CASA-auth-token/server-java/package/linux/CASA_auth_token_svc_4zen.spec.in @@ -26,7 +26,7 @@ Autoreqprov: on %define bldno @VERSION@ Version: @VERSION@ Release: 0 -Summary: Novell Common Authentication Services Adapter Authentication Token Infrastructure "Java" (CASA_auth_token) +Summary: Novell CASA Authentication Token Service Source: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: jre >= 1.5.0 @@ -37,40 +37,40 @@ PreReq: /usr/sbin/groupadd, /usr/sbin/useradd, /usr/sbin/userdel, /usr/bi BuildArchitectures: noarch %description -CASA_auth_token is an authentication token infrastructure with support for multiple -authentication mechanisms with an emphasis on providing a scalable single -sign-on solution. +CASA_auth_token is an authentication token infrastructure with support for +multiple authentication mechanisms with an emphasis on providing a scalable +single sign-on solution. -A key feature of CASA_auth_token is that its authentication tokens contain identity -information about the entity being authenticated. This information is made available -to the consuming services. The amount of information contained in the tokens is -configured on a per-service basis. Because of this feature, we say that CASA_auth_token -projects an "Authenticated Identity". +A key feature of CASA_auth_token is that its authentication tokens contain +identity information about the entity being authenticated. This information is +made available to the consuming services. The amount of information contained in +the tokens is configured on a per-service basis. Because of this feature, we say +that CASA_auth_token projects an "Authenticated Identity". -The CASA_auth_token_svc is the infrastructure component responsible for authenticating -entities using the native authentication mechanism and for issuing tokens that can later -be used by applications to authenticate the entity o services that are CASA authentication -enabled. +The CASA_auth_token_svc is the infrastructure component responsible for +authenticating entities using the native authentication mechanism and for issuing +tokens that can later be used by applications to authenticate the entity or +services that are CASA authentication enabled. %package -n CASA_auth_token_jaas_support -Summary: Libraries needed for JAAS applications development. +Summary: Novell CASA Authentication Token JAAS Support Components Group: Applications/System -Requires: jre >= 1.5.0 CASA_auth_token_svc jdk novell-zenworks-java-links +Requires: jre >= 1.5.0 CASA_auth_token_svc jdk novell-zenworks-java-links log4j %description -n CASA_auth_token_jaas_support -CASA_auth_token is an authentication token infrastructure with support for multiple -authentication mechanisms with an emphasis on providing a scalable single -sign-on solution. +CASA_auth_token is an authentication token infrastructure with support for +multiple authentication mechanisms with an emphasis on providing a scalable +single sign-on solution. -A key feature of CASA_auth_token is that its authentication tokens contain identity -information about the entity being authenticated. This information is made available -to the consuming services. The amount of information contained in the tokens is -configured on a per-service basis. Because of this feature, we say that CASA_auth_token -projects an "Authenticated Identity". +A key feature of CASA_auth_token is that its authentication tokens contain +identity information about the entity being authenticated. This information is +made available to the consuming services. The amount of information contained in +the tokens is configured on a per-service basis. Because of this feature, we say +that CASA_auth_token projects an "Authenticated Identity". The CASA_auth_token_jaas_support package contains the CASA (Common Authentication -Services Adapter) authentication token infrastructure JAAS module and supporting libraries -for token verification. +Services Adapter) authentication token infrastructure JAAS module and supporting +libraries for token verification. %prep %setup -q @@ -242,16 +242,14 @@ fi %postun # Always undeploy our webapp to force re-deployment on upgrade cases +echo "Cleaning up webapp folders" rm -drf /srv/www/casaats/webapps/CasaAuthTokenSvc +rm -drf /srv/www/casaats/work/Catalina +rm -f /srv/www/casaats/conf/server.xml %restart_on_update casa_atsd %insserv_cleanup -# Do not do anything else if this is an upgrade -if test "$1" == 1; then - exit 0 -fi - %files %defattr(-,root,root)