CaseyS95 Member since 2019 3 posts
Posted: 11 months ago
Last activity: 11 months 1 week ago

How do I set a user identifier using Java in Pega?

Hello again,

I'm working on setting up SSO in Pega. I think I'm making some progress, but I've run into an issue I don't know how to resolve. We use an API Gateway to authenticate a user and a cookie is set containing the user's ID. I can get this ID from the cookie using Java in my authentication activity, however, I can't set the .pyUserIdentifier parameter. I'm trying to use the following code:

pega.setViaPropRef(".pyUserIdentifier", userIdentifierArr, myStepPage,
                    cookie.getValue(), "sTN", false, false);

Just as an FYI, I grabbed this from some generated Java code from when this value was being defaulted using an Obj-Open method. However, in this case, I get an NPE because myStepPage is null.

Is there a better way for me to set the ID of the current user so that when a user connects to the system they are automatically logged in? Or, is there a way I can make sure that myStepPage is not null, such as defaulting to a reasonable value?

Data Integration Java and Activities
Share this page LinkedIn