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.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fd91138be6e11a1295e90f282df0c8e398725af3e0f5a15ba318e5730435fa1 |
|
MD5 | 5db5f44a86f30a0632277737c4c87760 |
|
BLAKE2b-256 | 01bfb5e738b02edebab1bb698e13173aa59700d4e09c86c80b9aa0103f3c765d |