16
Views
3
Comments
[DocuSign 2.1 APIs] Error: invalid_grant / no_valid_keys_or_signatures
Question
docusign2-1apis
Service icon
Forge asset by Robert Adams
Application Type
Service

Hello,

I've created private and public key files using commands prompted by the documentation:

  • openssl genrsa -aes256 -out my_private_key.pem 2048

  • openssl rsa -pubout -in my_private_key.pem -out my_public_key.pem

In both cases I've interactively supplied the required password, the same in all cases.

Then I've upload both files and the password to the DocusignConfigurator (and did all other steps).

But when I try to sign some file, using the DocusignReactiveDemo, I get an error:

{"error":"invalid_grant","error_description":"no_valid_keys_or_signatures"}

What can be the reason?

Regards

Tomasz


2024-07-18 10-54-11
Abhishek Hayaran

Hi, can you please confirm if you have already given the Consent?

This error might occur if you have not given the Consent with proper scope.


Generate the Consent URL

Use DocuSign's consent URL format:


https://account-d.docusign.com/oauth/auth

  ?response_type=code

  &scope=signature%20impersonation

  &client_id=YOUR_INTEGRATION_KEY

  &redirect_uri=YOUR_REDIRECT_URI

  

  Replace the placeholders:

YOUR_INTEGRATION_KEY: The Integration Key.

YOUR_REDIRECT_URI: The URI you registered for the app.


For Example https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature%20impersonation&client_id=abc123&redirect_uri=https://example.com/callback


Request Consent

Share the generated URL with the user (or open it in a browser).

The user will log in to their DocuSign account and grant permissions.

Once consent is given, the user is redirected to the REDIRECT_URI with a code parameter.


After receiving the authorization code, exchange it for an access token:


POST https://account-d.docusign.com/oauth/token

Content-Type: application/x-www-form-urlencoded


grant_type=authorization_code

&code=YOUR_AUTHORIZATION_CODE

&client_id=YOUR_INTEGRATION_KEY

&client_secret=YOUR_CLIENT_SECRET

&redirect_uri=YOUR_REDIRECT_URI


You’ll receive an access token to make API calls on behalf of the user.



UserImage.jpg
Tomasz M Lipinski

Hello,

Yes, I have given the required consent. 

I'm sure that now the only issue is the way, the .pem files are created. The truth is that I have a pair of keys that work. I managed to create them but now I cannot repeat the way, I did it.

Kind regards

Tomasz

2025-07-22 10-30-27
Mandar Deshpande

HI @Tomasz M Lipinski 

The invalid_grant / no_valid_keys_or_signatures error in the DocuSign APIs usually means the JWT authentication signature cannot be validated by DocuSign.

You can try regenerating the key without password encryption, upload again, and the error should disappear.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.