/** {@inheritDoc} */
protected void doParse(Element config, BeanDefinitionBuilder builder) {
log.debug("Parsing configuration for {} authentication handler.", XMLHelper.getXSIType(config).getLocalPart());
-
- int duration = Integer.parseInt(config.getAttributeNS(null, "authenticationDuration"));
+
+ int duration = 30;
+ if (config.hasAttributeNS(null, "authenticationDuration")) {
+ duration = Integer.parseInt(config.getAttributeNS(null, "authenticationDuration"));
+ }
log.debug("Authentication handler declared duration of {} minutes", duration);
builder.addPropertyValue("authenticationDuration", duration);
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
/**
* Spring bean definition parser for remote user authentication handlers.
*/
-public class RemoteUserLoginHandlerBeanDefinitionParser extends
- AbstractLoginHandlerBeanDefinitionParser {
-
+public class RemoteUserLoginHandlerBeanDefinitionParser extends AbstractLoginHandlerBeanDefinitionParser {
+
/** Schema type. */
public static final QName SCHEMA_TYPE = new QName(ProfileHandlerNamespaceHandler.NAMESPACE, "RemoteUser");
protected void doParse(Element config, BeanDefinitionBuilder builder) {
super.doParse(config, builder);
- builder.addPropertyValue("protectedServletPath", DatatypeHelper.safeTrimOrNullString(config.getAttributeNS(
- null, "protectedServletPath")));
+ if (config.hasAttributeNS(null, "protectedServletPath")) {
+ builder.addPropertyValue("protectedServletPath", DatatypeHelper.safeTrimOrNullString(config.getAttributeNS(
+ null, "protectedServletPath")));
+ } else {
+ builder.addPropertyValue("protectedServletPath", "/Authn/RemoteUser");
+ }
}
}
\ No newline at end of file
/**
* Spring bean definition parser for username/password authentication handlers.
*/
-public class UsernamePasswordLoginHandlerBeanDefinitionParser extends
- AbstractLoginHandlerBeanDefinitionParser {
+public class UsernamePasswordLoginHandlerBeanDefinitionParser extends AbstractLoginHandlerBeanDefinitionParser {
/** Schema type. */
public static final QName SCHEMA_TYPE = new QName(ProfileHandlerNamespaceHandler.NAMESPACE, "UsernamePassword");
-
+
/** Class logger. */
private final Logger log = LoggerFactory.getLogger(UsernamePasswordLoginHandlerBeanDefinitionParser.class);
protected void doParse(Element config, BeanDefinitionBuilder builder) {
super.doParse(config, builder);
- builder.addPropertyValue("authenticationServletURL", DatatypeHelper.safeTrim(config.getAttributeNS(null,
- "authenticationServletURL")));
+ if (config.hasAttributeNS(null, "authenticationServletURL")) {
+ builder.addPropertyValue("authenticationServletURL", DatatypeHelper.safeTrim(config.getAttributeNS(null,
+ "authenticationServletURL")));
+ } else {
+ builder.addPropertyValue("authenticationServletURL", "/Authn/UserPassword");
+ }
String jaasConfigurationURL = DatatypeHelper.safeTrim(config.getAttributeNS(null, "jaasConfigurationLocation"));
log.debug("Setting JAAS configuration file to: {}", jaasConfigurationURL);
protected void doParse(Element config, BeanDefinitionBuilder builder) {
super.doParse(config, builder);
- builder.addConstructorArg(DatatypeHelper.safeTrimOrNullString(config.getAttributeNS(null,
- "authenticationManagerPath")));
+ if (config.hasAttributeNS(null, "authenticationManagerPath")) {
+ builder.addConstructorArgValue(DatatypeHelper.safeTrimOrNullString(config.getAttributeNS(null,
+ "authenticationManagerPath")));
+ } else {
+ builder.addConstructorArgValue("/AuthnEngine");
+ }
}
}
\ No newline at end of file
protected void doParse(Element config, BeanDefinitionBuilder builder) {
super.doParse(config, builder);
- builder.addConstructorArg(DatatypeHelper.safeTrimOrNullString(config.getAttributeNS(null,
- "authenticationManagerPath")));
+ if (config.hasAttributeNS(null, "authenticationManagerPath")) {
+ builder.addConstructorArgValue(DatatypeHelper.safeTrimOrNullString(config.getAttributeNS(null,
+ "authenticationManagerPath")));
+ } else {
+ builder.addConstructorArgValue("/AuthnEngine");
+ }
}
}
\ No newline at end of file
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="SAML2ProfileHandler">
- <xsd:attribute name="authenticationManagerPath" type="xsd:string" default="/AuthnEngine">
+ <xsd:attribute name="authenticationManagerPath" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
The context relative path to the authentication manager used by this profile handler. This
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="SAML1ProfileHandler">
- <xsd:attribute name="authenticationManagerPath" type="xsd:string" default="/AuthnEngine">
+ <xsd:attribute name="authenticationManagerPath" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
The context relative path to the authentication manager used by this profile handler. This
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
- <xsd:attribute name="reportPreviousSessionAuthnMethod" type="xsd:boolean" default="false">
+ <xsd:attribute name="reportPreviousSessionAuthnMethod" type="xsd:boolean">
<xsd:annotation>
<xsd:documentation>
Whether this login handler should report its authentication method as PreviousSession or the
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
- <xsd:attribute name="supportsPassiveAuthentication" type="xsd:boolean" default="false">
+ <xsd:attribute name="supportsPassiveAuthentication" type="xsd:boolean">
<xsd:annotation>
<xsd:documentation>
Whether this login handler, when redirecting to a servlet, support passives authentication.
<xsd:complexType name="RemoteUser">
<xsd:complexContent>
<xsd:extension base="LoginHandlerType">
- <xsd:attribute name="protectedServletPath" type="xsd:string" default="/Authn/RemoteUser">
+ <xsd:attribute name="protectedServletPath" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
The servlet context path to the
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
- <xsd:attribute name="authenticationServletURL" type="xsd:string" default="/Authn/UserPassword">
+ <xsd:attribute name="authenticationServletURL" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
The servlet context path to the
</xsd:annotation>
</xsd:element>
</xsd:sequence>
- <xsd:attribute name="authenticationDuration" type="xsd:positiveInteger" default="30">
+ <xsd:attribute name="authenticationDuration" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>
The length of time, in minutes, that an authentication performed by this handler should be