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')
Release files for threefoldlogin 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| threefoldlogin-0.0.1.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| threefoldlogin-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.7 kB
Release files / threefoldlogin-0.0.1.tar.gz
| Download URL | threefoldlogin-0.0.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5485128ba27619bbde222dfdd3bf538a1bef9319e02f1bf0774926831437de61
|
|
BLAKE2b-256 checksum How to use checksums |
ecd755a5490b2d0cdf31109f9155bbfaf46674d226da2c650811fbc324bef887
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / threefoldlogin-0.0.1-py3-none-any.whl
| Download URL | threefoldlogin-0.0.1-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c5692f272c7aa9bfef7a7833cfa5a265388ec44d111da2a5b119b190c40d7ea
|
|
BLAKE2b-256 checksum How to use checksums |
e0d1c790f86b5930b62055bd7727519ebd0386515bd85ae9fc42957f15798164
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|