I have configured the API as per given steps and given appconsent.
But after all when i tried it is giving error as mentioned in screenshot.Can anyone help me on this ?
Hey Folks,I have resolved the issue using following approach: 1.As Issue produced was in createJWT where CreateSignedAsymmetricTokenWithPemKey was not returing Token due to Private key accessiblity.2.So I have used two commands to generate keys again as per suggested in JWT demo documemtation -
1. openssl genpkey -algorithm RSA -out rsa_private.pem -pkeyopt rsa_keygen_bits:20482. openssl rsa -in rsa_private.pem -pubout -out rsa_public.pemThen i have fed generated keys in API configurations and it worked and generated Token.FYI- These keys generated are not using password phrase.Cheers
Hi,
It is 2 years later but the problem remains the same. I've used suggested commands. DocusignConfigurator refused using no password so I've completed the "openssl genpkey" command with "-aes256" parameter and supplied the password interactively. Then I've replaced the .pem files in DocusignConfigurator. Still no success, still the same "Unexpected error while signing the token".
The header of the private key file is "BEGIN ENCRYPTED PRIVATE KEY". I've tried "BEGIN RSA PRIVATE KEY" and "BEGIN PRIVATE KEY" (appropriately changing the footer, of course). No success.
I've also checked that the files are UTF-8 encoded.
Has anybody any idea?
Regards
Tomasz
After the newest JWT library is installed the issue is gone.
Hi @Pratap Singh Naruka,Have you checked if the request body you sent is correct? method, headers, auths, etc..
Cheers,
Alec
when I debugged i found error -"Unexpected error while signing the token: Unable to open private key. Validate if private key in PEM format and password is correct."
Hi @Alec ManabatAs I found it was not problem with request but with opening private key to generate Token.FYI- Here in action CreateSignedAsymmetricTokenWithPemKey accepts Private key in PKCS#8 or PKCS#5 PEM standard format.I am not sure what can be the reason for this:"Unexpected error while signing the token: Unable to open private key. Validate if private key in PEM format and password is correct."Thanks
Hi @Pratap Singh Naruka Please have a look at this thread on stackoverflowhttps://stackoverflow.com/questions/18460035/unable-to-load-private-key-pem-routinespem-read-biono-start-linepem-lib-c6
Tried these options and solutions didn't work for me