Removed superfluous base 64 encoding/decoding.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Mon, 4 Apr 2005 22:14:34 +0000 (22:14 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Mon, 4 Apr 2005 22:14:34 +0000 (22:14 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1375 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/idp/IdPResponder.java
src/edu/internet2/middleware/shibboleth/idp/provider/E_AuthSSOHandler.java
src/edu/internet2/middleware/shibboleth/idp/provider/SAMLv1_1ArtifactQueryHandler.java
src/edu/internet2/middleware/shibboleth/idp/provider/SAMLv1_AttributeQueryHandler.java
src/edu/internet2/middleware/shibboleth/idp/provider/ShibbolethV1SSOHandler.java

index bc1fd04..cb693b9 100644 (file)
@@ -50,7 +50,6 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 
-import sun.misc.BASE64Decoder;
 import edu.internet2.middleware.shibboleth.aa.arp.ArpEngine;
 import edu.internet2.middleware.shibboleth.aa.arp.ArpException;
 import edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeResolver;
@@ -300,16 +299,8 @@ public class IdPResponder extends HttpServlet {
                        // If we have DEBUG logging turned on, dump out the request to the log
                        // This takes some processing, so only do it if we need to
                        if (log.isDebugEnabled()) {
-                               try {
-                                       log.debug("Dumping generated SAML Request:"
-                                                       + System.getProperty("line.separator")
-                                                       + new String(new BASE64Decoder().decodeBuffer(new String(samlRequest.toBase64(), "ASCII")),
-                                                                       "UTF8"));
-                               } catch (SAMLException e) {
-                                       log.error("Encountered an error while decoding SAMLRequest for logging purposes.");
-                               } catch (IOException e) {
-                                       log.error("Encountered an error while decoding SAMLRequest for logging purposes.");
-                               }
+                               log.debug("Dumping generated SAML Request:" + System.getProperty("line.separator")
+                                               + samlRequest.toString());
                        }
 
                        // Determine which protocol handler is active for this endpoint
@@ -344,15 +335,8 @@ public class IdPResponder extends HttpServlet {
                        SAMLResponse samlResponse = new SAMLResponse((samlRequest != null) ? samlRequest.getId() : null, null,
                                        null, exception);
                        if (log.isDebugEnabled()) {
-                               try {
-                                       log.debug("Dumping generated SAML Error Response:"
-                                                       + System.getProperty("line.separator")
-                                                       + new String(
-                                                                       new BASE64Decoder().decodeBuffer(new String(samlResponse.toBase64(), "ASCII")),
-                                                                       "UTF8"));
-                               } catch (IOException e) {
-                                       log.error("Encountered an error while decoding SAMLReponse for logging purposes.");
-                               }
+                               log.debug("Dumping generated SAML Error Response:" + System.getProperty("line.separator")
+                                               + samlResponse.toString());
                        }
                        binding.respond(httpResponse, samlResponse, null);
                        log.debug("Returning SAML Error Response.");
index aef3f23..ca71e74 100644 (file)
@@ -51,7 +51,6 @@ import org.opensaml.SAMLSubject;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import sun.misc.BASE64Decoder;
 import edu.internet2.middleware.shibboleth.common.RelyingParty;
 import edu.internet2.middleware.shibboleth.common.ShibbolethConfigurationException;
 import edu.internet2.middleware.shibboleth.idp.IdPProtocolHandler;
@@ -190,10 +189,8 @@ public class E_AuthSSOHandler extends SSOHandler implements IdPProtocolHandler {
                        SAMLAssertion[] assertions = {new SAMLAssertion(issuer, new Date(System.currentTimeMillis()), new Date(
                                        System.currentTimeMillis() + 300000), conditions, null, Arrays.asList(statements))};
                        if (log.isDebugEnabled()) {
-                               log.debug("Dumping generated SAML Assertions:"
-                                               + System.getProperty("line.separator")
-                                               + new String(new BASE64Decoder().decodeBuffer(new String(assertions[0].toBase64(), "ASCII")),
-                                                               "UTF8"));
+                               log.debug("Dumping generated SAML Assertions:" + System.getProperty("line.separator")
+                                               + assertions[0].toString());
                        }
                        return null;
                } catch (CloneNotSupportedException e) { // TODO handle return null; } }
index 89bffb2..ef0495c 100644 (file)
@@ -43,7 +43,6 @@ import org.opensaml.SAMLResponse;
 import org.opensaml.artifact.Artifact;
 import org.w3c.dom.Element;
 
-import sun.misc.BASE64Decoder;
 import edu.internet2.middleware.shibboleth.artifact.ArtifactMapping;
 import edu.internet2.middleware.shibboleth.common.ShibbolethConfigurationException;
 import edu.internet2.middleware.shibboleth.idp.IdPProtocolHandler;
@@ -160,16 +159,8 @@ public class SAMLv1_1ArtifactQueryHandler extends BaseServiceHandler implements
                // The spec says that we should send "success" in the case where no artifacts match
                SAMLResponse samlResponse = new SAMLResponse(samlRequest.getId(), null, assertions, null);
                if (log.isDebugEnabled()) {
-                       try {
-                               log.debug("Dumping generated SAML Response:"
-                                               + System.getProperty("line.separator")
-                                               + new String(new BASE64Decoder().decodeBuffer(new String(samlResponse.toBase64(), "ASCII")),
-                                                               "UTF8"));
-                       } catch (SAMLException e) {
-                               log.error("Encountered an error while decoding SAMLReponse for logging purposes.");
-                       } catch (IOException e) {
-                               log.error("Encountered an error while decoding SAMLReponse for logging purposes.");
-                       }
+                       log.debug("Dumping generated SAML Response:" + System.getProperty("line.separator")
+                                       + samlResponse.toString());
                }
 
                support.getTransactionLog().info(
index a5f9fb5..158b2b4 100644 (file)
@@ -56,7 +56,6 @@ import org.opensaml.SAMLStatement;
 import org.opensaml.SAMLSubject;
 import org.w3c.dom.Element;
 
-import sun.misc.BASE64Decoder;
 import edu.internet2.middleware.shibboleth.aa.AAException;
 import edu.internet2.middleware.shibboleth.common.InvalidNameIdentifierException;
 import edu.internet2.middleware.shibboleth.common.NameIdentifierMappingException;
@@ -292,17 +291,8 @@ public class SAMLv1_AttributeQueryHandler extends BaseServiceHandler implements
                        }
 
                        if (log.isDebugEnabled()) { // This takes some processing, so only do it if we need to
-                               try {
-                                       log.debug("Dumping generated SAML Response:"
-                                                       + System.getProperty("line.separator")
-                                                       + new String(
-                                                                       new BASE64Decoder().decodeBuffer(new String(samlResponse.toBase64(), "ASCII")),
-                                                                       "UTF8"));
-                               } catch (SAMLException e) {
-                                       log.error("Encountered an error while decoding SAMLReponse for logging purposes.");
-                               } catch (IOException e) {
-                                       log.error("Encountered an error while decoding SAMLReponse for logging purposes.");
-                               }
+                               log.debug("Dumping generated SAML Response:" + System.getProperty("line.separator")
+                                               + samlResponse.toString());
                        }
 
                        log.info("Successfully created response for principal (" + principal.getName() + ").");
index 3192047..9beddf8 100644 (file)
@@ -363,15 +363,8 @@ public class ShibbolethV1SSOHandler extends SSOHandler implements IdPProtocolHan
                                                now, then, Collections.singleton(condition), null, Collections.singleton(statement));
 
                                if (log.isDebugEnabled()) {
-                                       try {
-                                               log.debug("Dumping generated Attribute Assertion:"
-                                                               + System.getProperty("line.separator")
-                                                               + new String(new BASE64Decoder().decodeBuffer(new String(attrAssertion.toBase64(),
-                                                                               "ASCII")), "UTF8"));
-
-                                       } catch (Exception e) {
-                                               log.error("Unable to dump assertion to debug log: " + e);
-                                       }
+                                       log.debug("Dumping generated Attribute Assertion:" + System.getProperty("line.separator")
+                                                       + attrAssertion.toString());
                                }
                                return attrAssertion;
                        }
@@ -437,7 +430,7 @@ public class ShibbolethV1SSOHandler extends SSOHandler implements IdPProtocolHan
 
                if (log.isDebugEnabled()) {
                        log.debug("Dumping generated AuthN Assertion:" + System.getProperty("line.separator")
-                                       + new String(new BASE64Decoder().decodeBuffer(new String(assertion.toBase64(), "ASCII")), "UTF8"));
+                                       + assertion.toString());
                }
 
                return assertion;