Implement stubbed out Artifact encoders and decoders
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sun, 19 Aug 2007 13:25:30 +0000 (13:25 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sun, 19 Aug 2007 13:25:30 +0000 (13:25 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@2337 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/idp/profile/saml1/ArtifactResolution.java
src/edu/internet2/middleware/shibboleth/idp/profile/saml1/ShibbolethSSODecoder.java
src/edu/internet2/middleware/shibboleth/idp/profile/saml2/ArtifactResolution.java

index dd97189..22558a1 100644 (file)
@@ -27,8 +27,10 @@ import org.opensaml.common.binding.artifact.SAMLArtifactMap;
 import org.opensaml.common.binding.artifact.SAMLArtifactMap.SAMLArtifactMapEntry;
 import org.opensaml.common.binding.decoding.SAMLMessageDecoder;
 import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml1.binding.SAML1ArtifactMessageContext;
 import org.opensaml.saml1.core.Assertion;
 import org.opensaml.saml1.core.AssertionArtifact;
+import org.opensaml.saml1.core.NameIdentifier;
 import org.opensaml.saml1.core.Request;
 import org.opensaml.saml1.core.Response;
 import org.opensaml.saml1.core.Status;
@@ -272,9 +274,10 @@ public class ArtifactResolution extends AbstractSAML1ProfileHandler {
         return samlResponse;
     }
 
-    /** Represents the internal state of a SAML 2.0 Artiface resolver request while it's being processed by the IdP. */
+    /** Represents the internal state of a SAML 1 Artiface resolver request while it's being processed by the IdP. */
     public class ArtifactResolutionRequestContext extends
-            BaseSAML1ProfileRequestContext<Request, Response, ArtifactResolutionConfiguration> {
+            BaseSAML1ProfileRequestContext<Request, Response, ArtifactResolutionConfiguration> implements
+            SAML1ArtifactMessageContext<Request, Response, NameIdentifier> {
 
         /** Artifact to be resolved. */
         private Collection<String> artifacts;
index dd14252..11133a8 100644 (file)
@@ -56,7 +56,7 @@ public class ShibbolethSSODecoder extends BaseMessageDecoder implements SAMLMess
         ShibbolethSSORequestContext requestContext = (ShibbolethSSORequestContext) messageContext;
         HTTPInTransport transport = (HTTPInTransport) messageContext.getInboundMessage();
 
-        String providerId = DatatypeHelper.safeTrimOrNullString(transport.getParameter("providerId"));
+        String providerId = DatatypeHelper.safeTrimOrNullString(transport.getParameterValue("providerId"));
         if (providerId == null) {
             log.error("No providerId parameter given in Shibboleth SSO authentication request.");
             throw new MessageDecodingException(
@@ -64,21 +64,21 @@ public class ShibbolethSSODecoder extends BaseMessageDecoder implements SAMLMess
         }
         requestContext.setPeerEntityId(providerId);
 
-        String shire = DatatypeHelper.safeTrimOrNullString(transport.getParameter("shire"));
+        String shire = DatatypeHelper.safeTrimOrNullString(transport.getParameterValue("shire"));
         if (shire == null) {
             log.error("No shire parameter given in Shibboleth SSO authentication request.");
             throw new MessageDecodingException("No shire parameter given in Shibboleth SSO authentication request.");
         }
         requestContext.setSpAssertionConsumerService(shire);
 
-        String target = DatatypeHelper.safeTrimOrNullString(transport.getParameter("target"));
+        String target = DatatypeHelper.safeTrimOrNullString(transport.getParameterValue("target"));
         if (target == null) {
             log.error("No target parameter given in Shibboleth SSO authentication request.");
             throw new MessageDecodingException("No target parameter given in Shibboleth SSO authentication request.");
         }
         requestContext.setRelayState(target);
 
-        String timeStr = DatatypeHelper.safeTrimOrNullString(transport.getParameter("time"));
+        String timeStr = DatatypeHelper.safeTrimOrNullString(transport.getParameterValue("time"));
         if (timeStr != null) {
             long time = Long.parseLong(timeStr);
             requestContext.setTime(time);
index f510358..0575140 100644 (file)
@@ -25,8 +25,10 @@ import org.opensaml.common.binding.artifact.SAMLArtifactMap;
 import org.opensaml.common.binding.artifact.SAMLArtifactMap.SAMLArtifactMapEntry;
 import org.opensaml.common.binding.decoding.SAMLMessageDecoder;
 import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.binding.SAML2ArtifactMessageContext;
 import org.opensaml.saml2.core.ArtifactResolve;
 import org.opensaml.saml2.core.ArtifactResponse;
+import org.opensaml.saml2.core.NameID;
 import org.opensaml.saml2.core.Status;
 import org.opensaml.saml2.core.StatusCode;
 import org.opensaml.saml2.metadata.AssertionConsumerService;
@@ -95,7 +97,7 @@ public class ArtifactResolution extends AbstractSAML2ProfileHandler {
                 requestContext.setFailureStatus(buildStatus(StatusCode.SUCCESS_URI, StatusCode.REQUEST_DENIED_URI,
                         "Unknown artifact."));
             }
-            
+
             if (!artifactEntry.getIssuerId().equals(requestContext.getLocalEntityId())) {
                 log.error("Artifact issuer mismatch.  Artifact issued by " + artifactEntry.getIssuerId()
                         + " but IdP has entity ID of " + requestContext.getLocalEntityId());
@@ -243,11 +245,11 @@ public class ArtifactResolution extends AbstractSAML2ProfileHandler {
         samlResponse.setIssueInstant(issueInstant);
         populateStatusResponse(requestContext, samlResponse);
 
-        if(requestContext.getFailureStatus() == null){
+        if (requestContext.getFailureStatus() == null) {
             Status status = buildStatus(StatusCode.SUCCESS_URI, null, null);
             samlResponse.setStatus(status);
             samlResponse.setMessage(requestContext.getReferencedMessage());
-        }else{
+        } else {
             samlResponse.setStatus(requestContext.getFailureStatus());
         }
 
@@ -273,7 +275,8 @@ public class ArtifactResolution extends AbstractSAML2ProfileHandler {
 
     /** Represents the internal state of a SAML 2.0 Artiface resolver request while it's being processed by the IdP. */
     public class ArtifactResolutionRequestContext extends
-            BaseSAML2ProfileRequestContext<ArtifactResolve, ArtifactResponse, ArtifactResolutionConfiguration> {
+            BaseSAML2ProfileRequestContext<ArtifactResolve, ArtifactResponse, ArtifactResolutionConfiguration>
+            implements SAML2ArtifactMessageContext<ArtifactResolve, ArtifactResponse, NameID> {
 
         /** Artifact to be resolved. */
         private String artifact;