Rolling Token verificator & generator
Project description
Rolling Token Authentication
Usage
Initialization
from rolling_token_auth import RollingTokenManager
manager = RollingTokenManager("secret", interval=3600)
The interval
defines how long a token is valid in seconds. Shorter = more secure.
Both secret
and interval
must match between generation and verification.
Generation
manager.generate_token()
This generates a token for the current timestamp. Optionally a offset
can be declared.
Verification
manager.is_valid(token)
This checks if the given token is valid for the current timestamp. The manager.tolerance
parameter defines how many token from the past and future are still valid (default: 1 in each direction).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for rolling_token_auth-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08c9efee33ab0b1d3d6391328bd023a1d6f975172f5235337c2e15accc82e3b5 |
|
MD5 | e3c29e7db9da63191715f0823c4a5615 |
|
BLAKE2b-256 | 0cccad6cd86b9e0d8a94133a3efd315cbcb81882eb5bd3cb8160ee6ec789bb6e |