Implementation of a JSON web token following RFC 7519 for Pharo.
For pharo9 and above use
Metacellonewbaseline:'JSONWebToken';
repository:'github://noha/JSONWebToken/source';
loadThe class JSONWebTokenTest demonstrates how to encode/serialize a web signature to a token string using compact base 64 notation as well as deserialization:
testRoundtrip
| jwstokenStringmaterialized |
jws :=JsonWebSignaturenewalgorithmName:'HS256';
payload: (JWTClaimsSetnewat:'bar'put:'foo').
jws key:'foobar'.
tokenString := jws compactSerialized.
materialized :=JsonWebSignaturematerializeCompact: tokenString key:'foobar'.
selfassert: jws equals: materialized