Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

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

Was this useful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us