Description
NPE is caused due the return value of org.apache.zeppelin.realm.LdapRealm method queryForAuthorizationInfo is null if authorizationEnabled = false (false is the default)
The null is not correctly handled by org.apache.zeppelin.utils.SecurityUtils and the login attempt always fails with:
Caused by: java.lang.NullPointerException at org.apache.zeppelin.utils.SecurityUtils.getRoles(SecurityUtils.java:144) at org.apache.zeppelin.rest.LoginRestApi.postLogin(LoginRestApi.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) ... 50 more
Even when the authentication was successful and authorizationEnabled=false we are not able to login to the zeppelin ui.
Issue was introduced by pull https://github.com/apache/zeppelin/pull/2498