Question
1
Replies
894
Views
Accenture
Posted: September 3, 2018
Last activity: September 10, 2018
Closed
Solved
Unable to retrieve JWK public key
I am getting an exception while trying to process the JWT Web Token in Pega which is generated and sent by another application for authentication. I am getting a following exception. I am not sure whats the problem is, the Truststore and JWT Authentication profile are correctly configured. The message is in the
screenshot below
2018-09-03 10:58:59,624 [ WebContainer : 28] [ STANDARD] [ ] [ XXXAuth:01.01.04] (ta_Admin_Security_Token.Action) ERROR pegadev.com|XXX.CC.206.135 y04439 - Unable to process the Json Web Token
com.pega.pegarules.pub.PRRuntimeException: Unable to retrieve JWK public key
at com.pega.pegarules.integration.engine.internal.security.jwt.NimbusJWTProcessor.validateSignedJWT(NimbusJWTProcessor.java:536) ~[printegrint.jar:?]
at com.pega.pegarules.integration.engine.internal.security.jwt.NimbusJWTProcessor.processGeneratedJsonWebToken(NimbusJWTProcessor.java:421) ~[printegrint.jar:?]
at com.pega.pegarules.integration.engine.internal.security.jwt.JWTUtilsImpl.processJSONWebToken(JWTUtilsImpl.java:210) ~[printegrint.jar:?]
at com.pegarules.generated.activity.ra_action_processjwt_3d7b9df7fd7fcba1933451274e705478.step3_circum0(ra_action_processjwt_3d7b9df7fd7fcba1933451274e705478.java:366) ~[?:?]
at com.pegarules.generated.activity.ra_action_processjwt_3d7b9df7fd7fcba1933451274e705478.perform(ra_action_processjwt_3d7b9df7fd7fcba1933451274e705478.java:108) ~[?:?]
at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3597) ~[prprivate.jar:?]
The JWT Token got generated with a different JWT Library as Pega is using.
When we realized that pega is using the com.nimbusds library, we changed the generation of the token by using the nimbusds library from the following maven dependency and it worked.
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>6.0.1</version>
</dependency>