Skip to main content

const jwtLifeSec = 24 * 60 * 60; // 1 day in seconds (3600 * 24)

 

const dsApiClient = new ApiClient();

dsApiClient.setBasePath(

this.configService.get<string>('docusign.base_path'),

);

 

const results = await dsApiClient.requestJWTUserToken(

this.configService.get<string>('docusign.integration_key'),

this.configService.get<string>('docusign.user_id'),

pthis.configService.get<string>('docusign.scope')],

this.privateKey,

jwtLifeSec,

);


I added like that ti’s not working. it’s always return expire_in : 3600

I wana more than. How can I do that Please someone help me.

Hi ​@david009,

You’re absolutely right that a limitation of using the JSON Web Token (JWT) Grant flow is that the access token it provides expires after one hour (expires_in: 3600), and no refresh token is issued. This behavior is by design, as the JWT Grant flow prioritizes security by requiring a new JWT to be generated and exchanged for a new access token each time the previous one expires.

Unfortunately, it's not possible to extend the expires_in value beyond 3600 seconds with this flow. If you’re looking for a solution that offers a longer-lived token or a refresh token, you might consider using another authentication method, like the Authorization Code Grant flow.

https://developers.docusign.com/platform/auth/jwt/#:~:text=When%20not%20using%20one%20of,no%20refresh%20token%20is%20provided.


Thanks ​@Islam.Hassanein 

let me know,

when I sent out, I got envelop url to sign
but this doc have only 10min expires

how can I config to get more expire like 1 day or 2 days

 

const envelopesApi = this.getEnvelopApi(access_token);

const envelope = this.makeEnvelope(data);

 

const results = await envelopesApi.createEnvelope(

this.configService.get<string>('docusign.account_id'),

{ envelopeDefinition: envelope },

);

 

const { viewRequest, returnUrl } = this.makeRecipientViewRequest(

token,

uen,

data.email,

name,

data.agreement_no,

results.envelopeId,

);

 

const view_results = await envelopesApi.createRecipientView(

this.configService.get<string>('docusign.account_id'),

results.envelopeId,

{ recipientViewRequest: viewRequest },

);


Reply