Python package for the threebot authenticator app
Project description
Python package for interacting with threefold login
Usage
Initialize the authenticator
from ThreefoldLoginPkg import ThreefoldLogin
import string
import random
api_host = 'https://login.staging.jimber.org'
app_id = 'testapp'
seed_phrase = seed_phrase = 'calm science teach foil burst until ' \
'next mango hole sponsor fold bottom ' \
'cousin push focus track truly tornado ' \
'turtle over tornado teach large fiscal'
redirect_url = "/callback"
kyc_backend_url = 'https://openkyc.staging.jimber.org'
authenticator = ThreefoldLogin (api_host,
app_id,
seed_phrase,
redirect_url,
kyc_backend_url
)
Generate a login request
allowed = string.ascii_letters + string.digits
state = ''.join(random.SystemRandom().choice(allowed) for _ in range(32))
url = authenticator.generate_login_url(state)
Redirect the user to the giving URL
Redirect the user to url
Callback
The callback will be send to https://{app_id}/{redirect_url}
try:
authenticator.parse_and_validate_redirect_url(callback_url, state)
print('successfully validated login attempt')
if authenticator.is_email_verified():
print('email is verified')
else:
print('email is not verified')
except ValueError:
print('failed to validate login attempt')
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
threefoldlogin-0.0.1.tar.gz
(3.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file threefoldlogin-0.0.1.tar.gz.
File metadata
- Download URL: threefoldlogin-0.0.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/51.1.1 requests-toolbelt/0.8.0 tqdm/4.55.1 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5485128ba27619bbde222dfdd3bf538a1bef9319e02f1bf0774926831437de61
|
|
| MD5 |
156456a541018e2029a7b2a1c767831c
|
|
| BLAKE2b-256 |
ecd755a5490b2d0cdf31109f9155bbfaf46674d226da2c650811fbc324bef887
|
File details
Details for the file threefoldlogin-0.0.1-py3-none-any.whl.
File metadata
- Download URL: threefoldlogin-0.0.1-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/51.1.1 requests-toolbelt/0.8.0 tqdm/4.55.1 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c5692f272c7aa9bfef7a7833cfa5a265388ec44d111da2a5b119b190c40d7ea
|
|
| MD5 |
cdd6196fe5ff860100fea9f266a087a7
|
|
| BLAKE2b-256 |
e0d1c790f86b5930b62055bd7727519ebd0386515bd85ae9fc42957f15798164
|