JSON web tokens are a common way to pass data safely through the web, and here’s an open source library from Auth0 submitted by Martin Gontovnikas for decoding JWTs.
The library provides methods for easily extracting JSON data and expiry dates from the web tokens, and also provides convenience methods for checking whether the web token is expired.
This example from the readme shows how to decode a web token in Swift:
let payload = A0JWTDecoder.payloadOfJWT(jwt, error: &error)
println("JWT payload is :")
You can find JWTDecode.iOS on Github here.
A nice easy way to decode JSON Web TOkens.
Submit A Resource
Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?
You can submit the url here.
The resources we feel will appeal to our readers the most will be posted on the front page.