TODO
- Add more examples
- Improve coverage
Features
- Manages & Orchestrates JWT for user login, logout & renew
- Easy start
- No un-safe code
- Runs on stable rust
- Library approach (Requires no runtime)
- Supports plugable components (Store & Hasher)
- Invalidates old refresh upon new refresh token renewal
- Invalidates old authentication upon new authentication token renewal
- Handles Thundering herd problem upon authentication token expiry
Quickstart
Dependencies:
[]
= "*"
$ curl https://raw.githubusercontent.com/sgrust01/jwtvault/master/generate_certificates.sh > ./generate_certificates.sh
./generate_certificates.sh
use *;
use HashMap;
Workflows
-
To begin use
loginwith user and password-
Upon successful login is provides user will be provided with JWT pair (authentication/refresh)
-
Authentication token is then provided to access any resources
-
Refresh token is used to renew an authentication token upon expiry
-
-
Use
resolve_server_token_from_client_authentication_tokenwith user and authentication_token to restore user session -
Use
renewwith user and refresh_token to generate new authentication token -
Use
logoutwith user and authentication_token will remove all tokens associated with the user