I can't authenticate with DocuSign's OAuth JWT because of the error Unexpected PEM Type
. I'm using their Nuget package 2.2.0. If I change to 2.1.10 and tweak my code slightly I get this error
Error calling Login: {
"errorCode": "PARTNER_AUTHENTICATION_FAILED",
"message": "The specified Integrator Key was not found or is disabled. An Integrator key was not specified."
}
I only have a Sandbox account, which I have created an Integrator Key. My redirect uri is https://docusign.com
and I created an RSA Keypair which I saved the private key in a PEM file.
I'm following the instructions here https://github.com/docusign/docusign-csharp-client/blob/master/README.md but an exception is raised on the line OAuth.OAuthToken tokenInfo = apiClient.ConfigureJwtAuthorizationFlowByKey(integratorKey, userId, oauthBasePath, privateKey, expiresInHours);
I have also granted access to JWT using the url https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature%20impersonation&client_id=<integrator-key>&redirect_uri=https://docusign.com
.
string userId = "e1f43c1a-2546-4317-85a9-cea367f8f92c";
string oauthBasePath = "account-d.docusign.net";
string integratorKey = "<integrator-key>";
string privateKey = @"C:\Users\me\privateKey.pem";
int expiresInHours = 1;
string host = "https://demo.docusign.net/restapi";
AuthorizationUri
needs to match your redirect url in your integrator key – Amourpropre