docusign / docusign-esign-csharp-client

The Official Docusign C# Client Library used to interact with the eSignature REST API. Send, sign, and approve documents using this client.
https://developers.docusign.com/docs/esign-rest-api/sdks/csharp/
MIT License
130 stars 159 forks source link

Docusign Setting "iat" parameter in C# #324

Closed sameedaris closed 3 months ago

sameedaris commented 3 years ago

Hello, Currently DocuSign client is setting current system time as "iat" parameter. This causes issue when system time is not correct. As this is not required parameter from DocuSign we would like to know how to set it to null ? Thanks.

ivdinkovds commented 3 years ago

@sameedaris According to the code "iat" ie IssuedAt = DateTime.UtcNow, is set as UtcNow According to Microsoft UtcNow Gets a DateTime object that is set to the current date and time on this computer, expressed as the Coordinated Universal Time (UTC). I would advise making sure your server time is correctly synced You can not set it to NULL, this value will be assigned at run time based on your server time

sameedaris commented 3 years ago

This is reply from docusign support:

After reviewing with my internal team, this error appears to be caused by an incorrect server time. In order to resolve, your client will need to ensure their server clock is correct & synced. Otherwise, should the time be correct, it may help to manually build in some slack such as "current time - 5 minutes" or not setting the 'iat' parameter as it is not required, unlike the 'exp' parameter which is required.

ivdinkovds commented 3 years ago

@sameedaris RequestJWTUserToken method requires only expiration time. "iat" is set in the method itself IssuedAt = DateTime.UtcNow at run time and is using server time. You can not set it to NULL or alter it. I am really not sure what is the meaning of

manually build in some slack such as "current time - 5 minutes"

ivdinkovds commented 3 years ago

I assume you can manually build your assertion and directly call the auth endpoint but because you have opened an issue here I guess you plan to use the SDK client

sameedaris commented 3 years ago

Thanks All the help @ivdinkovds .

avinfinity commented 3 months ago

Closing this issue as it has been already resolved. Thanks