https://github.com/clj-pkg/jwt
The minimal implementation of JWT on Clojure
https://github.com/clj-pkg/jwt
jwt jwt-token
Last synced: 4 months ago
JSON representation
The minimal implementation of JWT on Clojure
- Host: GitHub
- URL: https://github.com/clj-pkg/jwt
- Owner: clj-pkg
- License: mit
- Created: 2020-09-05T12:03:37.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-13T09:15:30.000Z (over 5 years ago)
- Last Synced: 2025-10-24T10:34:24.811Z (8 months ago)
- Topics: jwt, jwt-token
- Language: Clojure
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Clojure JWT  [](https://clojars.org/clj-pkg/jwt)
This is a minimal implementation of JWT on Clojure inspired by Go version [robbert229/jwt](https://github.com/robbert229/jwt).
## What is JWT?
JSON Web Token (JWT) is a compact URL-safe means of representing claims to be transferred between two parties. Learn more [jwt.io](https://jwt.io/).
## What algorithms does it support?
* HS256
## How does it work?
### Installation
Include in your project.clj

```clojure
(require [clj-pkg.jwt :as jwt])
```
### How to create a token?
Creating a token is actually pretty easy.
```clojure
(jwt/sign (jwt/jwt :hs256 {:a "1" :b "2"}) "ThisIsTheSecret")
```
### How to validate a token?
```clojure
(jwt/verify (jwt/str->jwt valid-jwt) "ThisIsTheSecret")
```