i2b2 1.8.3 PM Cell with LDAP authentication returns an invalid XML response when Active Directory rejects invalid credentials.
AD correctly returns LDAP error code 49 with diagnostic code data 52e. The exception message contains a NULL character (Unicode 0). ServicesHandler forwards e.getMessage() unfiltered to MessageFactory.doBuildErrorResponse().
Axiom/Woodstox then fails with:
WstxUnexpectedCharException: Illegal character (NULL, unicode 0) encountered: not valid in any content
As a result, the webclient receives an AJAX failure and displays:
The PM Cell is down or the address in the properties file is incorrect.
Expected result:
A valid i2b2 XML error response containing Authentication failed.
Suggested fix: Catch javax.naming.AuthenticationException in SecurityAuthenticationLDAP and return a neutral message such as Authentication failed. Additionally, all exception messages included in XML should be stripped of characters invalid under XML 1.0.
i2b2 1.8.3 PM Cell with LDAP authentication returns an invalid XML response when Active Directory rejects invalid credentials.
AD correctly returns LDAP error code 49 with diagnostic code data 52e. The exception message contains a NULL character (Unicode 0). ServicesHandler forwards e.getMessage() unfiltered to MessageFactory.doBuildErrorResponse().
Axiom/Woodstox then fails with:
WstxUnexpectedCharException: Illegal character (NULL, unicode 0) encountered: not valid in any content
As a result, the webclient receives an AJAX failure and displays:
The PM Cell is down or the address in the properties file is incorrect.
Expected result:
A valid i2b2 XML error response containing Authentication failed.
Suggested fix: Catch javax.naming.AuthenticationException in SecurityAuthenticationLDAP and return a neutral message such as Authentication failed. Additionally, all exception messages included in XML should be stripped of characters invalid under XML 1.0.