PDF Generated with an error message

  • 14 January 2016
  • 2 replies
  • 2 views

Badge +2

Hi All,

 

We have an event in the workflow (K2 Studio) that generates a PDF from a URL. Until yesterday this was working perfectly but today the PDF generates and all we get is a blank form with the message - 

ID4243: Could not create a SecurityToken. A token was not found in the token cache and no cookie was found in the context.

 

The guidance we found so far suggests authentication is failing maybe due to a session cookie being stored in the cache. On checking the config file both settings are set to the default 8 hours. Given that this form is opening within the workflow and not by a user we are confused as to how the session is expiring.

We restarted the K2Blackpearl service and the PDF is generating again but how can we prevent the error happening again?

 

TIA,

Mevan

 


16605i3DB88096069BFAF7.png

2 replies

Badge +6

Hi, MKattan,

 

This is expected behavior. The lifetime of a browser security token is not infinite. Eventually they expire and K2 will no longer be able to authenticate. Can you clear the browser cache, close the window, and reopen it to see if that resolves the issue?

 

The settings of those tokens are configured in:


C:Program Files (x86)K2 blackpearlWebServicesIdentitySTS

Edit the web.config – there you will find 2 settings:
<add key="SessionTokenLifetime" value="28800" />
<add key="MaximumTokenLifetime" value="28800" />

Values are in seconds (default 8hrs)

 

Hope this helps!

 

Kind Regards,

MA

Badge +9

An alternative solution would be to create a secondary runtime site for PDF generation and set it to Windows authentication, this will avoid getting the issue of the claims token expiring or whatnot.

Reply