NPE in LDAP Authentication

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NPE in LDAP Authentication

Shiva Shankar
Hi
I was using 1.1M3 successfully with AD Authentication. However, once i have upgraded to 1.1M4, i get an NPE. The LDAP config in xwiki.cfg is identical in both versions, and are as per documentation on xwiki.org.
Regards
Shiva
------------------------------------------------------------------------------------------------------
java.lang.NullPointerException
        at com.xpn.xwiki.user.impl.LDAP.LDAPAuthServiceImpl.authenticate(LDAPAuthServiceImpl.java:51)
        at com.xpn.xwiki.user.impl.xwiki.MyFormAuthenticator.authenticate(MyFormAuthenticator.java:195)
        at com.xpn.xwiki.user.impl.xwiki.MyFormAuthenticator.processLogin(MyFormAuthenticator.java:95)
        at com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl.checkAuth(XWikiAuthServiceImpl.java:211)
        at com.xpn.xwiki.XWiki.checkAuth(XWiki.java:3000)
        at com.xpn.xwiki.user.impl.xwiki.XWikiRightServiceImpl.checkAccess(XWikiRightServiceImpl.java:112)
        at com.xpn.xwiki.XWiki.checkAccess(XWiki.java:3008)
        at com.xpn.xwiki.XWiki.prepareDocuments(XWiki.java:3881)
        at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:132)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
        at java.lang.Thread.run(Unknown Source)
<SCRIPT type=text/javascript><!-- if( Nabble.ads ) { Nabble.ads(); } //--></SCRIPT> <SCRIPT> if( self == top ) { Nabble.writeReturnToLink( '<a href="' +( Nabble.tview == "dump" ? 'http://www.nabble.com/1.1M4%3A-NPE-IN-LDAP-Authentication-t4278846.html' : 'http://www.nabble.com/1.1M4%3A-NPE-IN-LDAP-Authentication-tf4278846.html' ) + '" target="_top">Return to thread</a>' ); } else if( Nabble.prev ) Nabble.writeReturnToLink(Nabble.prev); </SCRIPT>


Hotmail to go? Get your Hotmail, news, sports and much more! Check out the New MSN Mobile

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: NPE in LDAP Authentication

Ludovic Dubost

Hi,

The null pointer is here

  public Principal authenticate(String ldapusername, String password,
XWikiContext context) throws XWikiException {
        Principal principal = null;

        // Trim the username to allow users to enter their names with
spaces before or after
        String username  = ldapusername.replaceAll(" ", "");


This is indeed new code in M4.. I'm adding a bug in JIRA. It will be
fixed in RC1
Indeed this should not do a null pointer. Do you get this after typing
your credentials or when clicking on login ?

Ludovic

Shiva Shankar a écrit :

> Hi
> I was using 1.1M3 successfully with AD Authentication. However, once i
> have upgraded to 1.1M4, i get an NPE. The LDAP config in xwiki.cfg is
> identical in both versions, and are as per documentation on xwiki.org.
> Regards
> Shiva
> ------------------------------------------------------------------------------------------------------
>
> java.lang.NullPointerException
>         at
> com.xpn.xwiki.user.impl.LDAP.LDAPAuthServiceImpl.authenticate(LDAPAuthServiceImpl.java:51)
>
>         at
> com.xpn.xwiki.user.impl.xwiki.MyFormAuthenticator.authenticate(MyFormAuthenticator.java:195)
>
>         at
> com.xpn.xwiki.user.impl.xwiki.MyFormAuthenticator.processLogin(MyFormAuthenticator.java:95)
>
>         at
> com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl.checkAuth(XWikiAuthServiceImpl.java:211)
>
>         at com.xpn.xwiki.XWiki.checkAuth(XWiki.java:3000)
>         at
> com.xpn.xwiki.user.impl.xwiki.XWikiRightServiceImpl.checkAccess(XWikiRightServiceImpl.java:112)
>
>         at com.xpn.xwiki.XWiki.checkAccess(XWiki.java:3008)
>         at com.xpn.xwiki.XWiki.prepareDocuments(XWiki.java:3881)
>         at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:132)
>         at
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
>
>         at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
>
>         at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
>         at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
>
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>
>         at
> com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
>
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
>
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
>
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
>
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
>
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
>
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
>
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
>
>         at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
>
>         at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
>
>         at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
>
>         at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
>
>         at java.lang.Thread.run(Unknown Source)
>
>
> ------------------------------------------------------------------------
> Hotmail to go? Get your Hotmail, news, sports and much more! Check out
> the New MSN Mobile <http://mobile.msn.com>

--
Ludovic Dubost
Blog: http://www.ludovic.org/blog/
XWiki: http://www.xwiki.com
Skype: ldubost GTalk: ldubost
AIM: nvludo Yahoo: ludovic



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

ludovic.vcf (301 bytes) Download Attachment