Remove most defaults from schemas - SIDP-204
[java-idp.git] / src / main / java / edu / internet2 / middleware / shibboleth / idp / config / profile / authn / PreviousSessionLoginHandlerBeanDefinitionParser.java
index 6b89bfc..afc823b 100644 (file)
@@ -45,10 +45,18 @@ public class PreviousSessionLoginHandlerBeanDefinitionParser extends AbstractLog
         builder.addPropertyValue("servletPath", DatatypeHelper.safeTrimOrNullString(config.getAttributeNS(null,
                 "servletPath")));
 
-        builder.addPropertyValue("supportsPassiveAuth", XMLHelper.getAttributeValueAsBoolean(config.getAttributeNodeNS(
-                null, "supportsPassiveAuthentication")));
-
-        builder.addPropertyValue("reportPreviousSessionAuthnMethod", XMLHelper.getAttributeValueAsBoolean(config
-                .getAttributeNodeNS(null, "reportPreviousSessionAuthnMethod")));
+        if (config.hasAttributeNS(null, "supportsPassiveAuthentication")) {
+            builder.addPropertyValue("supportsPassiveAuth", XMLHelper.getAttributeValueAsBoolean(config
+                    .getAttributeNodeNS(null, "supportsPassiveAuthentication")));
+        } else {
+            builder.addPropertyValue("supportsPassiveAuth", false);
+        }
+
+        if (config.hasAttributeNS(null, "reportPreviousSessionAuthnMethod")) {
+            builder.addPropertyValue("reportPreviousSessionAuthnMethod", XMLHelper.getAttributeValueAsBoolean(config
+                    .getAttributeNodeNS(null, "reportPreviousSessionAuthnMethod")));
+        } else {
+            builder.addPropertyValue("reportPreviousSessionAuthnMethod", false);
+        }
     }
 }
\ No newline at end of file