Question

How to generate JWT token with custom header using OOTB Token Profile Data Instance

We are using Token Profile data instance to create JSON webtoken (using the pxGenerateJWT activity). As per the pega help of Token Profile data instance ,The following required headers are added automatically:

https://community.pega.com/sites/default/files/help_v82/procomhelpmain.htm#data-/data-admin-/data-admin-security-/data-admin-security-token/generation.htm#Generation_tab_on_the_Token_Profile_form

alg – The used JWS algorithm, which is in the Security section, on the Generation tab.
cty – The content type is populated by default as application/json.
typ – The type is always JWT.
kid – The Key ID is a unique ID generated by the JWT runtime for each token generated.
crit – Headers that are marked as critical on the Generation tab.

The service which I am consuming for my application , requires us to send constant value for kid . How this can be achieved ?

Comments

Keep up to date on this post and subscribe to comments

April 14, 2019 - 8:48am

What service are you consuming? Can you elaborate on the use case? All the generation logic is in java code, we may need to investigate further and would like to know your use cases in details.

April 15, 2019 - 11:45am

Hi Kevin,

 We are trying to integrate with box using JWT . According to box documentation consumer needs to create a public key and store it in BOX. In turns BOX will generate an unique key (PublickeyID) which consumer needs to use for the generation(to sign the claims using the private key, we need to use PublickeyID as kid value) of the JWT. You may find their documentation from the URL below.
 
 https://developer.box.com/docs/construct-jwt-claim-manually#section-1-read-json-config

 

 

April 25, 2019 - 4:13pm

Anyone has found any workaround for this one?

June 18, 2019 - 12:55pm

We have run into the same problem as above in that the service we are calling is expecting the "kid" value in our JWT to be a public key thumbprint.  Is this possible?

July 19, 2019 - 12:17pm

We are running into a similar situation as well.  Is there a way to remove kid from the header?

July 23, 2019 - 3:34pm
Response to TerenceY0215

Hi @TerenceY0215!

This is an older thread and you may not receive a reply. Thank you for opening a new post to alert the rest of the Community with your question.

 

Marissa | Community Moderator | Pegasystems Inc.