Support Article
Unable to integrate with SSO Platform Using JWT
SA-88274
Summary
Pega application is integrated with an inhouse system that is used to authenticate user credentials (this is based on OAuth 2.0 protocol) for Single Sign-On (SSO) authentication and to route the login page where the user must to provide credentials. However, error occurs after entering the username and password.
Error Messages
There has been an issue; please consult your system administrator
Status:fail
Operator:Unauthenticated or not available
Node:No ID available
Error in the Pega logs:
com.pega.pegarules.pub.PRRuntimeException: Unable to execute OIDC flow : Caught exception while parsing the id token
at com.pega.pegarules.session.internal.mgmt.authentication.SchemePRAuth.authenticateOperator(SchemePRAuth.java:743) ~[prprivate.jar:?]
at com.pega.pegarules.session.internal.mgmt.authentication.Authentication.doAuthentication(Authentication.java:491) ~[prprivate.jar:?]
at com.pega.pegarules.session.internal.engineinterface.service.HTTPAuthenticationHandler.performAuthentication(HTTPAuthenticationHandler.java:251) ~[prprivate.jar:?]
at com.pega.pegarules.session.internal.engineinterface.service.HTTPAuthenticationHandler.doHttpReqAuthentication(HTTPAuthenticationHandler.java:94) ~[prprivate.jar:?]
Caused by: com.pega.pegarules.pub.PRRuntimeException: Caught exception while parsing the id token
at com.pega.pegarules.integration.engine.internal.sso.oidc.NimbusOIDCClientHandler.processIDToken(NimbusOIDCClientHandler.java:83) ~[printegrint.jar:?]
at com.pega.pegarules.integration.engine.internal.sso.oidc.OIDCClientHandler.processIDToken(OIDCClientHandler.java:192) ~[printegrint.jar:?]
at com.pega.pegarules.integration.engine.internal.sso.oidc.OIDCClientHandler.processAuthcodeRes(OIDCClientHandler.java:118) ~[printegrint.jar:?]
at com.pega.pegarules.integration.engine.internal.sso.oidc.OIDCClientHandler.authenticate(OIDCClientHandler.java:74) ~[printegrint.jar:?]
at com.pega.pegarules.session.internal.mgmt.authentication.SchemePRAuth.authenticateOperator(SchemePRAuth.java:726) ~[prprivate.jar:?]
Caused by: com.pega.pegarules.pub.PRRuntimeException: Unable to retrieve JWK public key
at com.pega.pegarules.integration.engine.internal.security.jwt.NimbusJWTProcessor.getJWSKeySelectorFromPubKey(NimbusJWTProcessor.java:550) ~[printegrint.jar:?]
at com.pega.pegarules.integration.engine.internal.security.jwt.NimbusJWTProcessor.getJWSKeySelector(NimbusJWTProcessor.java:480) ~[printegrint.jar:?]
at com.pega.pegarules.integration.engine.internal.sso.oidc.NimbusOIDCClientHandler.processIDToken(NimbusOIDCClientHandler.java:80) ~[printegrint.jar:?]
Steps to Reproduce
Integrate SSO through the JSON Web Token (JWT).
Root Cause
Pega considered various JWT libraries during design time. Java JSON Web Token (JJWT) and Nimbus are two popular (based on Maven Artifact usage) JWT libraries. However, JJWT does not support JSON Web Encryption (JWE). Therefore, Pega uses Nimbus for both JWS and JWE.
Resolution
The external system must use Nimbusds API to generate the JWT token.
Published December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.