-1
\$\begingroup\$

Is it possible to use JWT in my unity games?

I've read here that JWT needs .NET version 3.5+ and in Unity 5.4.1f1 the .NET version is "2.0.50727.1433". Is this information correct or incorrect?

If it is incorrect, can anyone point me to the right direction as to how I would go about implementing JWT in C#?

Sorry if I made any mistake, I'm completely new to JWT

\$\endgroup\$
1
\$\begingroup\$

afaik unity isn't currently capable of running on microsoft's own .NET framework, but rather uses mono an open clone of .NET

The version number you mentioned is the mono runtime version.

That version is roughly compatible with .NET 3.5

Whether or not you can run JWT will thus depend on whether you can compile and run the library you need on mono.

if there isn't any library that can actually decode / encode JWT requests and compiles / runs in mono, you'll have to write your own.

::update::

Looks like someone has done exactly that

https://github.com/monry/JWT-for-Unity

\$\endgroup\$
  • 1
    \$\begingroup\$ In Unity 2017 you can use the experimental .NET 4.6 compatible runtime, if the library doesn't work on 3.5. \$\endgroup\$ – Kroltan Sep 24 '17 at 0:46
  • \$\begingroup\$ At the time of this answer, that was an upcoming beta feature of unity (5.5) \$\endgroup\$ – Timothy Groote Sep 25 '17 at 7:33
  • 1
    \$\begingroup\$ I deleted this question before because I no longer need to use JWT in my game. However, the link you have provided in edit can be beneficial for anyone else stumbling upon this question. So I decided to un-delete this question and accept it as answer. Have a nice day. \$\endgroup\$ – Aditya Yadav Mar 25 '19 at 4:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.