LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Implement json web token JWT with labview

Solved!
Go to solution

I need to implement JWT authentication with labview, how can it be done?

0 Kudos
Message 1 of 11
(6,572 Views)

I guess you can try to play with this procedure.

http://digital.ni.com/public.nsf/allkb/DF41D5DA8EEB4840862577D90058C208

 

Any specific reason you want to use JSON?

0 Kudos
Message 2 of 11
(6,529 Views)

My Labview applivation need to get data from another Oracle based application (Not Labview).

The data is available in a web service with JWT authentication, I also need to deliver data in the same way (web service with JWT).

I didn't find any labview based tool or (activeX, .net) tool I can use for encryption decryption JWT.

0 Kudos
Message 3 of 11
(6,513 Views)

You will have to use the Import Web Service Wizard for authentication.
https://zone.ni.com/reference/en-XX/help/371361M-01/lvdialog/import_web_service_wizard/

Maggie M.
Application Engineer
National Instruments.
http://www.ni.com/support
0 Kudos
Message 4 of 11
(6,470 Views)
Solution
Accepted by topic author dor-s

I am not aware of an existing JWT library for LabVIEW. You can see from the JWT site that to creating and parsing JWT requires:

JSON encoder / decoder

base64 encode / decode

and a signature / encryption method (commonly HMACSHA256 built this depends on the Oracle application)

 

JSON encoding and decoding is available since LabVIEW 2013: https://zone.ni.com/reference/en-XX/help/371361K-01/glang/flat_unflat_string/

 

The other two are not available from NI, but have implementations in the LabVIEW community:

Base64:

https://decibel.ni.com/content/docs/DOC-5544

https://decibel.ni.com/content/docs/DOC-23233

 

Signature:

https://lavag.org/files/file/198-encryption/

https://decibel.ni.com/content/docs/DOC-22585

 

So unfortunately JWT support is not provided by default, but all the pieces needed to implement it should be there.

 


Milan
0 Kudos
Message 5 of 11
(6,436 Views)

Thank you for the detailed answer, It seems like this is the best way to implement it.

 

Dor

0 Kudos
Message 6 of 11
(6,370 Views)

I think JKI JSON is best fit for JSON serialization and deserialization needs with web services.

 

jki.net/tools#json

--
Tomi Maila
0 Kudos
Message 7 of 11
(6,321 Views)

Hi Tomi,

 

Just to clarify we were discussing JSON Web Tokens which is used as a component of some authentication / authorization systems. 

 

My understanding is the JKI JSON package just handles JSON parsing. It does not implement JWT / RFC 7519 correct?

 

If that's the case the JKI JSON package could be used for the JSON parsing, but there were more components being discussed in this thread.


Milan
0 Kudos
Message 8 of 11
(6,316 Views)

Milan, sorry for confusion. I was proposing using JKI JSON as part of the toolchain in creation of JWT implementation for LabVIEW. LabVIEW native JSON is not very useful in libraries as it is strongly typed and usually you don't know the type of the data at edit time when writing general purpose libraries (such as JWT library).

--
Tomi Maila
0 Kudos
Message 9 of 11
(6,299 Views)

Hi  dor-s!

How did you solve the signature issue?

Did you use HMACSHA256 encryption method or RSA Signature with SHA-256 encryption method?

HMACSHA256 is easy to do with the  libraries in https://lavag.org/files/file/198-encryption/ but I'm having problems with RSA Signature with SHA-256. Is there any library or VI for this?

 

Thanks in advance

0 Kudos
Message 10 of 11
(4,917 Views)