HttpServletRequest from IPSRequestContext

I wanted to retrieve the username and session so I can invoke APIs that require username and session.

One of the way is to invoke getRemoteUser and getSessionId on HttpServletRequest.

String user = request.getRemoteUser();
String session = RxRequestUtils.getSessionId(request);

However, in the preprocessor extension we have access to IPSRequestContext. So is there a way to get the HttpServletRequest from IPSRequestContext object?

manvinder

No, there’s no way to get the HttpServletRequest from the IPSRequestContext (there is a way to go the other way around: look at RxRequestUtils.getRequest() in the PSO Toolkit)

To get the user name use IPSRequestContext.getUserName(), and to get the session id use IPSRequestContext.getUserSessionId().

Of course, if you’re using 6.7, it’s no longer necessary to pass the session id and user name to most service API calls.

Dave