Open Sepiidae opened 9 years ago
While I agree that we shouldn't throw an NPE in this case, you cannot put links into the MDUI elements in general.
We have observed a similar behavior with MCB throwing NPE with mdui extentions with a logo url is present in an SP's metadata.
DEBUG [edu.internet2.middleware.assurance.mcb.authn.provider.ui.IDPUIHandler:188] - Found Logo in UIInfo, language=null ERROR [edu.internet2.middleware.assurance.mcb.authn.provider.MCBLoginServlet:758] - Exception calling submodule. java.lang.NullPointerException: null
And these extensions were valid and were working with Shib Idp 2.4.4 without the MCB. When these extensions were removed, MCB started working normal.
Here are the extentions that were present in the blackboard's metadata:
Problem is the following code not checking for Null language value .getXMLLang().equals(lang) in the following methods of IDPUIHandler.java getServiceName() getServiceLogo() getInformationURL() getPrivacyURL() when a language element lang="en" is missing in any of the mdui extention tag mdui:UIInfo
Our mdui:Logo element did not have this declared. Hence the NPE.
When our metadata is read MCB throws the following exception due to a missing null pointer check.
16:28:03.842 - ERROR [edu.internet2.middleware.assurance.mcb.authn.provider.MCBLoginServlet:602] - Exception calling submodule. java.lang.NullPointerException: null at edu.internet2.middleware.assurance.mcb.authn.provider.ui.IDPUIHandler.getServiceLogo(IDPUIHandler.java:190) ~[IDPUIHandler.class:na] at edu.internet2.middleware.assurance.mcb.authn.provider.MCBLoginServlet.doVelocity(MCBLoginServlet.java:692) [MCBLoginServlet.class:na] at edu.uchicago.identity.mcb.authn.provider.duo.DuoLoginSubmodule.displayLogin(DuoLoginSubmodule.java:102) ~[DuoLoginSubmodule.class:2.1.0] at edu.internet2.middleware.assurance.mcb.authn.provider.MCBLoginServlet.showMethods(MCBLoginServlet.java:594) [MCBLoginServlet.class:na] at edu.internet2.middleware.assurance.mcb.authn.provider.MCBLoginServlet.service(MCBLoginServlet.java:138) [MCBLoginServlet.class:na] at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) [servlet-api.jar:na]
Example UIInfo