Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noha/jsonwebtoken
A pharo implementation of JSON web token (JWT)
https://github.com/noha/jsonwebtoken
jwt pharo
Last synced: about 2 months ago
JSON representation
A pharo implementation of JSON web token (JWT)
- Host: GitHub
- URL: https://github.com/noha/jsonwebtoken
- Owner: noha
- License: mit
- Created: 2017-11-22T15:55:25.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-09-29T12:45:38.000Z (about 2 years ago)
- Last Synced: 2024-10-10T13:26:39.906Z (2 months ago)
- Topics: jwt, pharo
- Language: Smalltalk
- Homepage:
- Size: 91.8 KB
- Stars: 15
- Watchers: 8
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JSONWebToken for Pharo
[![Build Status](https://travis-ci.org/noha/JSONWebToken.svg?branch=master)](https://travis-ci.org/noha/JSONWebToken)
## Overview
Implementation of a JSON web token following [RFC 7519](https://tools.ietf.org/html/rfc7519) for [Pharo](http://www.pharo.org).
## Installation
For pharo9 and above use
```Smalltalk
Metacello new
baseline:'JSONWebToken';
repository: 'github://noha/JSONWebToken:pharo9-openssl1.1/source';
load
```For pharo8 and below use
```Smalltalk
Metacello new
baseline:'JSONWebToken';
repository: 'github://noha/JSONWebToken:master/source';
load
```## Usage
The class *JSONWebTokenTest* demonstrates how to encode/serialize a web signature to a token string using compact base 64 notation
as well as deserialization:```Smalltalk
testRoundtrip
| jws tokenString materialized |
jws := JsonWebSignature new
algorithmName: 'HS256';
payload: (JWTClaimsSet new
at: 'bar' put: 'foo').
jws key: 'foobar'.
tokenString := jws compactSerialized.
materialized := JsonWebSignature materializeCompact: tokenString key: 'foobar'.
self assert: jws equals: materialized```
## Further Infos
- [JWT, JWS and JWE for Not So Dummies!](https://medium.facilelogin.com/jwt-jws-and-jwe-for-not-so-dummies-b63310d201a3)