Added some debug statements and added the sample jaas application into

the package that is submitted to autobuild.
This commit is contained in:
Juan Carlos Luciani 2006-08-14 20:27:43 +00:00
parent 392a4e7695
commit f3126b10c9
12 changed files with 94 additions and 8 deletions

View File

@ -276,5 +276,6 @@ server/Jaas/src/com/Makefile
server/Jaas/src/com/novell/Makefile
server/Jaas/src/com/novell/casa/Makefile
server/Jaas/src/com/novell/casa/jaas/Makefile
server/Jaas/src/com/novell/casa/jaas/sample/Makefile
])

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Aug 14 14:25:27 MDT 2006 - jluciani@novell.com
- Added some debug statements and added the sample Jaas application into
the tar file that is submitted to autobuild.
-------------------------------------------------------------------
Mon Aug 7 10:28:32 MDT 2006 - schoi@novell.com
- This file has been created for CASA_auth_token_svc project for the first

View File

@ -22,7 +22,10 @@
SUBDIRS = src
DIST_SUBDIRS = src
EXTRA_DIST = $(JAVAFILES)
EXTRA_DIST = $(JAVAFILES) \
make_and_run_test.sh \
make_test.sh \
run_test.sh
ROOT = ../..
@ -50,7 +53,7 @@ all: $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT)
$(BUILDDIR)/%.class: %.java
@echo [======== Compiling $@ ========]
$(JAVAC) -sourcepath src -classpath $(CLASSPATH) -d $(BUILDDIR)/classes $<
$(JAVAC) -g -sourcepath src -classpath $(CLASSPATH) -d $(BUILDDIR)/classes $<
$(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT): $(BUILDDIR) $(CLASSES)
@echo [======== Jarring $@ ========]

View File

@ -8,10 +8,10 @@ else
fi
fi
echo "*** Compiling the test application ***"
javac -sourcepath src -classpath ../../../lib/java/CasaJaasSupport.jar:../../../lib/java/CasaAuthToken.jar -d build-test/classes src/com/novell/casa/jaas/sample/SampleApp.java src/com/novell/casa/jaas/sample/SampleAppCallbackHandler.java
javac -g -sourcepath src -classpath ../../lib/java/CasaJaasSupport.jar:../../lib/java/CasaAuthToken.jar -d build-test/classes src/com/novell/casa/jaas/sample/SampleApp.java src/com/novell/casa/jaas/sample/SampleAppCallbackHandler.java
echo "*** Done compiling ***"
echo ""
echo "*** Starting the test application ***"
java -classpath build-test/classes:../../../lib/java/CasaJaasSupport.jar:../../../lib/java/CasaAuthToken.jar:/usr/share/java/xerces-j2.jar -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djava.security.auth.login.config=src/com/novell/casa/jaas/sample/SampleApp.conf com.novell.casa.jaas.sample.SampleApp
#jdb -sourcepath src:../AuthTokenSvc/src -classpath build-test/classes:../../../lib/java/CasaJaasSupport.jar:../../../lib/java/CasaAuthToken.jar:/usr/share/java/xerces-j2.jar -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djava.security.auth.login.config=src/com/novell/casa/jaas/sample/SampleApp.conf com.novell.casa.jaas.sample.SampleApp
java -classpath build-test/classes:../../lib/java/CasaJaasSupport.jar:../../lib/java/CasaAuthToken.jar:/usr/share/java/xerces-j2.jar -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djava.security.auth.login.config=src/com/novell/casa/jaas/sample/SampleApp.conf com.novell.casa.jaas.sample.SampleApp
#jdb -sourcepath src:../AuthTokenSvc/src -classpath build-test/classes:../../lib/java/CasaJaasSupport.jar:../../lib/java/CasaAuthToken.jar:/usr/share/java/xerces-j2.jar -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djava.security.auth.login.config=src/com/novell/casa/jaas/sample/SampleApp.conf com.novell.casa.jaas.sample.SampleApp

View File

@ -0,0 +1,13 @@
#!/bin/bash
if [ ! -d build-test ]; then
mkdir build-test
mkdir build-test/classes
else
if [ ! -d build-test/classes ]; then
mkdir build-test/classes
fi
fi
echo "*** Compiling the test application ***"
javac -g -sourcepath src -classpath ../../lib/java/CasaJaasSupport.jar:../../lib/java/CasaAuthToken.jar -d build-test/classes src/com/novell/casa/jaas/sample/SampleApp.java src/com/novell/casa/jaas/sample/SampleAppCallbackHandler.java
echo "*** Done compiling ***"

View File

@ -0,0 +1,4 @@
echo "*** Starting the test application ***"
java -classpath build-test/classes:../../lib/java/CasaJaasSupport.jar:../../lib/java/CasaAuthToken.jar:/usr/share/java/xerces-j2.jar -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djava.security.auth.login.config=src/com/novell/casa/jaas/sample/SampleApp.conf -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n com.novell.casa.jaas.sample.SampleApp
#jdb -sourcepath src:../AuthTokenSvc/src -classpath build-test/classes:../../lib/java/CasaJaasSupport.jar:../../lib/java/CasaAuthToken.jar:/usr/share/java/xerces-j2.jar -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djava.security.auth.login.config=src/com/novell/casa/jaas/sample/SampleApp.conf com.novell.casa.jaas.sample.SampleApp

View File

@ -20,9 +20,9 @@
#
#######################################################################
SUBDIRS =
SUBDIRS = sample
DIST_SUBDIRS =
DIST_SUBDIRS = sample
JAVAFILES = CasaLoginModule.java \
CasaPrincipal.java

View File

@ -0,0 +1,40 @@
#######################################################################
#
# Copyright (C) 2006 Novell, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Author: Juan Carlos Luciani <jluciani@novell.com>
#
#######################################################################
SUBDIRS =
DIST_SUBDIRS =
JAVAFILES = SampleAppCallbackHandler.java \
SampleApp.java
EXTRA_DIST = $(JAVAFILES) \
SampleApp.conf
.PHONY: package package-clean package-install package-uninstall
package package-clean package-install package-uninstall:
$(MAKE) -C $(TARGET_OS) $@
maintainer-clean-local:
rm -f Makefile.in

View File

@ -86,7 +86,7 @@ all: $(BUILDDIR)/$(WEBAPP) $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT)
$(BUILDDIR)/%.class: %.java
@echo [======== Compiling $@ ========]
$(JAVAC) -sourcepath src -classpath $(CLASSPATH) -d $(BUILDDIR)/webapp/WEB-INF/classes $<
$(JAVAC) -g -sourcepath src -classpath $(CLASSPATH) -d $(BUILDDIR)/webapp/WEB-INF/classes $<
$(BUILDDIR)/$(WEBAPP): $(BUILDDIR) $(CLASSES)
@echo [======== Creating Webapp $@ ========]

View File

@ -97,6 +97,11 @@ public class GetAuthPolicy implements RpcMethod
GetAuthPolicyRespMsg getAuthPolicyRespMsg = new GetAuthPolicyRespMsg(ProtoDefs.httpNotFoundStatusMsg,
ProtoDefs.httpNotFoundStatusCode);
out.println(getAuthPolicyRespMsg.toString());
System.err.println("GetAuthPolicy.invoke()- Service "
+ getAuthPolicyReqMsg.getServiceName()
+ " at " + getAuthPolicyReqMsg.getHostName()
+ " not enabled");
}
}
catch (Exception e)

View File

@ -232,6 +232,10 @@ public class Krb5Authenticate implements AuthMechanism, Serializable
identId = sr.getName() + "," + searchContext;
}
}
else
{
System.err.println("Krb5Authenticate.invoke()- No matching identity entities found");
}
}
catch (NamingException e)
{

View File

@ -162,6 +162,10 @@ public class PwdAuthenticate implements AuthMechanism, Serializable
"(cn={0})",
new String[] {pwToken.getUsername()},
controls);
if (!answer.hasMore())
{
System.err.println("PwdAuthenticate.invoke()- No matching identity entities found");
}
// Enumerate through the users returned checking the password
while (answer.hasMore())
@ -198,6 +202,12 @@ public class PwdAuthenticate implements AuthMechanism, Serializable
System.err.println("PwdAuthenticate.invoke()- NamingException: " + e.getExplanation());
}
}
// Check if we did not resolve the identity
if (identId == null)
{
System.err.println("PwdAuthenticate.invoke()- Failed to resolve identity for entity " + pwToken.getUsername());
}
}
catch (NamingException e)
{