More fixes to take care of the issue of authenticating users which exist

in containers with names that contain reserved XML characters.
This commit is contained in:
Juan Carlos Luciani 2007-06-07 22:29:11 +00:00
parent e0665ad76f
commit 87022ad2a0
3 changed files with 27 additions and 40 deletions

View File

@ -145,7 +145,7 @@ CLASSES = $(addprefix $(BUILDDIR)/, $(JAVAFILES:%.java=%.class))
XMLSEC_LIBS = $(XMLSEC_JARS_DIR)/xmlsec-1.4.0.jar
LIBS = /usr/share/java/servletapi5.jar:/usr/share/java/xerces-j2.jar:/usr/share/java/log4j.jar
LIBS = /usr/share/java/servletapi5.jar:/usr/share/java/xerces-j2.jar:/usr/share/java/log4j.jar:/usr/share/java/jakarta-commons-lang.jar
if LIB64
CASA_JAR = /usr/lib64/miCASA.jar
else

View File

@ -336,9 +336,6 @@ public final class CasaIdentityToken implements IdentityToken
// Verify that we are processing the expected tag
if (idElementName.equalsIgnoreCase(qName))
{
// Un-escape the identity id
m_casaIdentToken.m_identityId = StringEscapeUtils.unescapeXml(m_casaIdentToken.m_identityId);
// Advance to the next state
m_state = AWAITING_SOURCE_NAME_ELEMENT_START;
}
@ -406,40 +403,6 @@ public final class CasaIdentityToken implements IdentityToken
break;
case AWAITING_ATTRIBUTE_END:
// If necessary, un-escape the attribute data.
if (!m_encryptedAttrs)
{
Attribute attrib = m_casaIdentToken.m_attributes.remove(m_currAttribute);
if (attrib != null)
{
try
{
String attribData = (String) attrib.get();
if (attribData != null)
{
m_casaIdentToken.m_attributes.put(m_currAttribute,
StringEscapeUtils.unescapeXml(attribData));
}
else
{
m_log.error("SAXHandler.endElement()- Attribute data not found");
throw new SAXException("Attribute data not found");
}
}
catch (NamingException e)
{
m_log.error("SAXHandler.endElement()- Attribute data not found");
throw new SAXException("Attribute data not found", e);
}
}
else
{
m_log.error("SAXHandler.endElement()- Attribute not found");
throw new SAXException("Attribute not found");
}
}
// Advance to the next state
m_state = AWAITING_ATTRIBUTE_START;
break;
@ -511,7 +474,6 @@ public final class CasaIdentityToken implements IdentityToken
// Proceed based on our state
switch (m_state)
{
case AWAITING_ID_DATA:
// Consume the data
m_casaIdentToken.m_identityId = new String(ch, start, length);
@ -520,6 +482,11 @@ public final class CasaIdentityToken implements IdentityToken
m_state = AWAITING_ID_ELEMENT_END;
break;
case AWAITING_ID_ELEMENT_END:
// Consume the data
m_casaIdentToken.m_identityId = m_casaIdentToken.m_identityId.concat(new String(ch, start, length));
break;
case AWAITING_SOURCE_NAME_DATA:
// Consume the data
m_casaIdentToken.m_sourceName = new String(ch, start, length);
@ -528,6 +495,11 @@ public final class CasaIdentityToken implements IdentityToken
m_state = AWAITING_SOURCE_NAME_ELEMENT_END;
break;
case AWAITING_SOURCE_NAME_ELEMENT_END:
// Consume the data
m_casaIdentToken.m_sourceName = m_casaIdentToken.m_sourceName.concat(new String(ch, start, length));
break;
case AWAITING_SOURCE_URL_DATA:
// Consume the data
m_casaIdentToken.m_sourceUrl = new String(ch, start, length);
@ -536,6 +508,11 @@ public final class CasaIdentityToken implements IdentityToken
m_state = AWAITING_SOURCE_URL_ELEMENT_END;
break;
case AWAITING_SOURCE_URL_ELEMENT_END:
// Consume the data
m_casaIdentToken.m_sourceUrl = m_casaIdentToken.m_sourceUrl.concat(new String(ch, start, length));
break;
case AWAITING_TARGET_SERVICE_DATA:
// Consume the data
m_casaIdentToken.m_service = new String(ch, start, length);
@ -544,6 +521,11 @@ public final class CasaIdentityToken implements IdentityToken
m_state = AWAITING_TARGET_SERVICE_ELEMENT_END;
break;
case AWAITING_TARGET_SERVICE_ELEMENT_END:
// Consume the data
m_casaIdentToken.m_service = m_casaIdentToken.m_service.concat(new String(ch, start, length));
break;
case AWAITING_TARGET_HOST_DATA:
// Consume the data
m_casaIdentToken.m_host = new String(ch, start, length);
@ -560,6 +542,11 @@ public final class CasaIdentityToken implements IdentityToken
m_state = AWAITING_TARGET_HOST_ELEMENT_END;
break;
case AWAITING_TARGET_HOST_ELEMENT_END:
// Consume the data
m_casaIdentToken.m_host = m_casaIdentToken.m_host.concat(new String(ch, start, length));
break;
case AWAITING_ATTRIBUTE_DATA:
// Consume the data
//

View File

@ -54,4 +54,4 @@ server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar
# "foo/*.jar": Add all the JARs of the specified folder as class
# repositories
# "foo/bar.jar": Add bar.jar as a class repository
shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar,/usr/share/java/identity-abstraction/*.jar,/usr/share/java/CASA/*.jar
shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar,/usr/share/java/identity-abstraction/*.jar,/usr/share/java/CASA/*.jar,/usr/share/java/*.jar