Search code examples
c#androidjsonxamarinjson-web-token

Decode JSON Web Token (Xamarin.Android)


Basically I want to decode a base64 encoded JWT to extract the information in the body part.

I tried searching for possibilities to decode the token but all JWT Nuget-Packages don't work with my Xamarin.Android project since Mono doesn't have the assemblies and on their own forums there are no further informations about this topic.

Do you guys have a solution for this? Help would be much appreciated!


Solution

  • You can use the portable Version of JWT: https://github.com/senzacionale/jwt-portable-dotnet It's also available on NuGet https://www.nuget.org/packages/Portable.JWT/

    There is one error in the decode example. It's JWT.exceptions.SignatureVerificationException instead of JWT.SignatureVerificationException