Has anyone experienced the invalid_grant error mentioned in the subject here that gets an error calling ApiClient.RequestJWTUserToken ?
Here's my call. I've verified that I have values for my DSConfig fields.
private void UpdateToken()
{
ApiClient docusign_api = new ApiClient();
DSConfig cfg = new DSConfig();
const int jwtLifeSec = 10 * 60; // requested lifetime
//for the JWT is 10 min
List<string> scopes = new List<string>();
scopes.Add("signature");
// impersonation scope is implied due to use of JWT grant
OAuth.OAuthToken authToken = docusign_api.RequestJWTUserToken (DSConfig.ClientID,
DSConfig.ImpersonatedUserGuid,
DSConfig.AuthServer,
Encoding.UTF8.GetBytes(DSConfig.PrivateKey),
jwtLifeSec, scopes);
AccessToken = authToken.access_token;
if (Account == null)
Account = GetAccountInfo(authToken);
docusign_api = new ApiClient(Account.BaseUri + "/restapi");
expiresIn = DateTime.Now.Second + authToken.expires_in.Value;
}
public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, string oauthBasePath, byte[] privateKeyBytes, int expiresInHours, List<string> scopes = null);
{ "iss": "IntegratorKey", "sub": "UserId", "iat": 1536700971, "exp": 1536704571, "aud": "account-d.docusign.com", "scope": "impersonation signature" }- Amit K BistPOSTcall tohttps://account-d.docusign.com/oauth/tokenwith req body asgrant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=jwtassertioncreatedfromjwt.iowebsiteandContent-Typewill beapplication/x-www-form-urlencoded- Amit K Bist