[java-shib-idp2 COMMIT] in /branches/REL_2: doc/RELEASE-NOTES.txt src/main/java/edu/internet2/middleware/shibboleth/i...

noreply at shibboleth.net noreply at shibboleth.net
Tue Feb 21 19:21:28 GMT 2012


Author: lajoie
Date: Tue Feb 21 19:21:28 2012
New Revision: 3099

URL: http://svn.shibboleth.net/view/java-shib-idp2?rev=3099&view=rev
Log:
Be sure to set a Status when we throw a ProfileException (if we can) and if we try to create an error response and no failure Status is available use a default one - SIDP-538

Modified:
    branches/REL_2/doc/RELEASE-NOTES.txt
    branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/AbstractSAML1ProfileHandler.java
    branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/ArtifactResolution.java
    branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/ShibbolethSSOProfileHandler.java
    branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/AbstractSAML2ProfileHandler.java
    branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SSOProfileHandler.java
    branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/UnsolicitedSSODecoder.java

Modified: branches/REL_2/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/java-shib-idp2/branches/REL_2/doc/RELEASE-NOTES.txt?rev=3099&r1=3098&r2=3099&view=diff
==============================================================================
--- branches/REL_2/doc/RELEASE-NOTES.txt (original)
+++ branches/REL_2/doc/RELEASE-NOTES.txt Tue Feb 21 19:21:28 2012
@@ -2,6 +2,7 @@
 =============================================
 [SIDP-532] - ExternalAuthnSystemLoginHandler incorrectly logs as RemoteUserLoginHandler
 [SIDP-536] - LoginContext added to storage service twice but only cleared once
+[SIDP-538] - Response does not contain Status when assertion assigning is enabled but signing credential is improperly configured
 
 Changes in Release 2.3.5
 =============================================

Modified: branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/AbstractSAML1ProfileHandler.java
URL: http://svn.shibboleth.net/view/java-shib-idp2/branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/AbstractSAML1ProfileHandler.java?rev=3099&r1=3098&r2=3099&view=diff
==============================================================================
--- branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/AbstractSAML1ProfileHandler.java (original)
+++ branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/AbstractSAML1ProfileHandler.java Tue Feb 21 19:21:28 2012
@@ -408,7 +408,12 @@
         samlResponse.setIssueInstant(new DateTime());
         populateStatusResponse(requestContext, samlResponse);
 
-        samlResponse.setStatus(requestContext.getFailureStatus());
+        Status status = requestContext.getFailureStatus();
+        if(status == null){
+            status = buildStatus(StatusCode.RESPONDER, null, null);
+            requestContext.setFailureStatus(status);
+        }
+        samlResponse.setStatus(status);
 
         return samlResponse;
     }
@@ -591,6 +596,8 @@
         }
 
         if (signatureCredential == null) {
+            requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER, StatusCode.REQUEST_DENIED,
+                    "No signing credential available"));
             String msg = "No signing credential is specified for relying party configuration "
                     + requestContext.getRelyingPartyConfiguration().getProviderId();
             log.warn(msg);
@@ -606,6 +613,8 @@
             // TODO how to pull what keyInfoGenName to use?
             SecurityHelper.prepareSignatureParams(signature, signatureCredential, null, null);
         } catch (SecurityException e) {
+            requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER, StatusCode.REQUEST_DENIED,
+                    "Unable to prepare assertion signature"));
             String msg = "Error preparing signature for signing";
             log.error(msg);
             throw new ProfileException(msg, e);
@@ -618,10 +627,14 @@
             assertionMarshaller.marshall(assertion);
             Signer.signObject(signature);
         } catch (MarshallingException e) {
+            requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER, StatusCode.REQUEST_DENIED,
+                    "Unable to marshall assertion"));
             String errMsg = "Unable to marshall assertion for signing";
             log.error(errMsg, e);
             throw new ProfileException(errMsg, e);
         } catch (SignatureException e) {
+            requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER, StatusCode.REQUEST_DENIED,
+                    "Error computing assertion signature"));
             String msg = "Unable to sign assertion";
             log.error(msg, e);
             throw new ProfileException(msg, e);
@@ -659,6 +672,8 @@
 
             return signAssertion;
         } catch (MessageEncodingException e) {
+            requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER, StatusCode.REQUEST_DENIED,

[... 217 lines stripped ...]


More information about the commits mailing list