Files
EWF/library/security/jwt
Jocelyn Fiat a6806c676a Updated ecf files to version 1-16-0 .
Minor cosmetic changes.
2017-06-20 09:48:10 +02:00
..
2017-06-20 09:48:10 +02:00
2017-06-08 11:25:26 +02:00
2017-05-24 11:56:15 +02:00

JSON Web Token (JWT)

http://jwt.io/

Note: supporting only HS256 and none algorithm for signature.

How to use

	local
		jwt: JWT
	do
		create jwt
		tok := jwt.encoded_string ("[
			{"iss":"joe", "exp":1200819380,"http://example.com/is_root":true}
			]", "secret", "HS256")
		if
			attached jwt.decoded_string (tok, "secret", Void) as l_tok_payload and
			not jwt.has_error
		then
			check verified: not jwt.has_unverified_token_error end
			check no_error: not jwt.has_error end
			print (l_tok_payload)
		end
	end