Question

IP Australia
AU
Last activity: 13 Mar 2025 5:51 EDT
Retrieve OAuth2Client id_token through OIDC workflow
try {
String operator=tools.getParameterPage().getString("operator");
com.pega.pegarules.pub.connect.oauth2.OAuth2Client oauth2Client = pega.getServiceUtilsPriv().getOAuth2Client(tools,myStepPage,operator);
ClipboardPage accessToken = oauth2Client.retrieveAccessToken();
strAccessToken = oauth2Client.getAccessToken();
strPyExpiresAt = accessToken.getString("pyExpiresAt");
label = myStepPage.getString("pyLabel");
}
catch(Exception exp)
{
oLog.error("Token fetch failed :" + exp.getMessage());
}
We are trying to use the OAuthConnect to call the activity GetTokenFromOAuthProfile to retrieve an OAuth token that we can use to request a resource from another internal API.
There was a related question asked 9 years ago on 7.2.1 OAuth2 OpenID Connect Token support | Support Center where the answer was that Pega 7 didn't support OIDC OTTB.
Can someone please shed some light on the OAuth2Client class in 23 or 24 and let us know if there is a way to retrieve id_token in addition to the access_token?
We are able to see the id_token being part of the external auth (SSO) implementation for the users. However, in our use case, we need to make the id_token available to a Constellation custom UX component through the above mentioned activity (called by a data page).
Thank you in advance.
***Edited by Moderator Marije to add Product Enhancement plans EPIC ***