Hi Everyone, I am just looking for some advice on the issue of storing tokens for authentication in NAV.
We currently have a requirement which means we need to store a token, in our NAV DB so it can be easily changed through a page.
The issue is this token can be quite large in size, so a 250 character size text field will not cover it.
So naturally, the next thing I looked into was storing it in a Blob field.
I have created a function which will write the input into the blob field, and a function to return this blob as a text variable.
My function returns a text variable which doesn't have a defined length. So I would assume it can handle a much larger token than I am giving it.
The issue I am seeing is that when I debug, I don't get the full length token... is this just a quirk of the debugger?
I am currently trying to test this outside of NAV, but thought I would ask the question in the mean time.
This is the code I am using to store the token, run from the page when a user changes the token
IF SubmissionToken <> OriginalToken THEN
IF CONFIRM(UpdateTokenQst) THEN BEGIN
BinaryWriter := BinaryWriter.BinaryWriter(OutStr);
and this is the function I am using to then return this as a text variable
GetTokenAsText() Token : Text
BinaryReader := BinaryReader.BinaryReader(InStr);
IF NOT ISNULL(BinaryReader) THEN BEGIN
IF BinaryReader.BaseStream.Length > 0 THEN
Token := BinaryReader.ReadString;
I am just wondering if there is a better way to do this?