We have a requirement to validate the JWT token generated by External System in Pega, to implement this we have configured below rules.
Created the token profile.
Created the Custom Activity which is calling pxProcessJWT for JWT validation. Token profile and the JWT token is being passed as parameters to pxProcessJWT.
Configured the Custom Claims mapping.
Token validation is working fine but we are facing issue with claim mapping where the array(from JWT payload) is not being mapped to clipboard property. We tried mapping valuelist and Pagelist but nothing is getting mapped.
Also the JWT payload is not getting mapped
Appreciate any suggestion on this. Thanks.
***Edited by Moderator: Pooja Gadige to add platform capability tag***
@VjayaKumar_Coforge - If it is an array then it is difficult to map it using the token profile. Another approach will be to pass a property reference in the Param.payloadJSONLocation while calling pxProcessJWT. Once JWT is processed the referenced property will contain the JSON string which can then be parsed using DT or function
@KALINGAROUT - we can use the below engine api which is an alternative to pxProcessJWT activity. processJSONWebTokenAndGetPayload function validates the token and then returns the payload attributes in the form of Map. Below is the code snippet for the JWT validation and the fetching the attributes from the token payload.