annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

Implement json web token JWT with labview

Résolu !
Accéder à la solution

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

0 Compliments
Message 1 sur 11
9 379 Visites

I guess you can try to play with this procedure.

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019LgPSAU&l=en-US

 

Any specific reason you want to use JSON?

0 Compliments
Message 2 sur 11
9 336 Visites

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 Compliments
Message 3 sur 11
9 320 Visites

You will have to use the Import Web Service Wizard for authentication.
https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/vi-lib/platform/webservice/main-panel/main...

Maggie M.
Application Engineer
National Instruments.
http://www.ni.com/support
0 Compliments
Message 4 sur 11
9 277 Visites
Solution
Accepté par 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://www.ni.com/docs/en-US/bundle/labview-api-ref/page/menus/categories/programming/string/flatte...

 

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

Base64:

https://forums.ni.com/t5/Example-Code/LabVIEW-Utility-VIs-for-Base64-and-Base32Hex-Encoding-Using/ta...

https://forums.ni.com/t5/Example-Code/Fast-Base64-Encoder-Decoder-using-LabVIEW/ta-p/3503281

 

Signature:

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

https://forums.ni.com/t5/Example-Code/Cryptography/ta-p/3494085

 

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

 


Milan
Message 5 sur 11
9 243 Visites

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

 

Dor

0 Compliments
Message 6 sur 11
9 177 Visites

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

 

jki.net/tools#json

--
Tomi Maila
0 Compliments
Message 7 sur 11
9 128 Visites

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 Compliments
Message 8 sur 11
9 123 Visites

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 Compliments
Message 9 sur 11
9 106 Visites

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 Compliments
Message 10 sur 11
7 724 Visites