Now we follow SAML semantics for returning no attributes
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / aa / AASaml.java
index 2fded93..30dd93a 100755 (executable)
@@ -74,9 +74,12 @@ public class AASaml {
                                               sub.getConfirmationMethods(),
                                               sub.getConfirmationData());
             
-           SAMLStatement sStatement = new SAMLAttributeStatement(rSubject, attrs);
-           SAMLStatement[] statements = new SAMLStatement[1];
-           statements[0] = sStatement;
+           SAMLStatement[] statements = null;
+           if(attrs != null && attrs.length > 0){
+               statements = new SAMLStatement[1];
+               statements[0] = new SAMLAttributeStatement(rSubject, attrs);
+           }
+
            Date now = new Date();
            Date  then = null;
            if(attrs != null && attrs.length > 0){
@@ -111,4 +114,10 @@ public class AASaml {
            binding.respond(resp,sResp,ourSE);      
        }
     }
+
+    public void fail(HttpServletResponse resp, SAMLException exception)
+       throws IOException{
+
+       binding.respond(resp, null, exception);
+    }
 }