Support Article
NullPointerException while reading header for Rest Service
SA-11030
Summary
It is observed that getObject(“pxHTTPServletRequest”) returns null when the authentication activity is run through the REST service.
So user is unable to determine in the authentication activity, who is trying to login.
Error Messages
Not Applicable.
Steps to Reproduce
1. Create a Service Package with Custom Authentication Service
2. Configure with custom authentication activity with no additional challenge options. The Authentication activity just checks the http header for the user name.
3. Attempt to read the HTTP requestor header which contains the user name.
javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest)tools.getRequestor().getRequestorPage().getObject("pxHTTPServletRequest");
String ivuser = request.getHeader("user");
tools.putParamValue("user", user);
Root Cause
Servlet request object is not available in custom authentication activity.
Resolution
This issue is resolved by Hfix-22594.
Published July 6, 2015 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.