AnsweredAssumed Answered

Using OTK Session - Store to hold identifiers

Question asked by UoC on Sep 19, 2016
Latest reply on Sep 25, 2016 by Sascha Preibisch

Hi All.


I am trying to use the "OTK Session - Store" assertion to hold a JSON string that stores some identifiers related to the user of the OAuthToken issued


I then use the "OTK Session Get" assertion to retrieve it from the cache.

This seems to work, however, when I try and access the session variable using Assertions e.g. ${resp.mainpart} the json has been URL encoded. (Note: resp is a {Message} type)


The ${resp.mainpart} also includes "cache". Here is an example:

mainpart = {String} " %22UIC%22%3A%229988%22%2C+%22LIBRARY+BAR+CODE%22%3A%22CUI3%22%2C+%22Door+Access+Number%22%3A%2238%22%2C+%22Card+Number%22%3A%2296990400%22%2C+%22STAFFUSERNAME%22%3A%22testuser%22%2C+%22PERSONID%22%3A%927174%22%2C+%22UNIX+UID%22%3A%22187%22%2C+%22USERNAME%22%3A%22testuser2%22%2C+%22Staff+UNIX+UID%22%3A%222***%22 cache "


Does anyone know how I can easily get the JSON string back in its original format so I can get each of the values?

I can work through it with regex and a for Each assertions but is this neccesary or am i missing something/doing something incorrectly? I would have thought this would be a bit 'cleaner'.


Does anyone have any recommendations how I could store these so they are easily retrievable? Perhaps I should store each session value in an individually named cache?


If anyone has any recommendations on this or perhaps another way to achieve this, it would be greatly appreciated.


Many Thanks,