authenticate with cognito backend
Project description
villaAuthSdk
interact with villa authentication backend
Install
pip install villaAuthSdk
How to use
create an auth object
from villaAuthSdk.auth import AuthSdk
from nicHelper.dictUtil import printDict
authSdk=AuthSdk(user=None,pw=None,region='ap-southeast-1')
## user and pw here are the aws key/secret for your client
login
result=authSdk.auth(user='nic1',pw='12345678')
printDict(result)
AccessKeyId : ASIAVX4Z5T
SecretKey : I1Tt/7LxhM
SessionToken : IQoJb3JpZ2
Expiration : 1605681332.0
AccessToken : eyJraWQiOi
ExpiresIn : 3600
TokenType : Bearer
RefreshToken : eyJjdHkiOi
IdToken : eyJraWQiOi
NewDeviceMetadata
DeviceKey : ap-southea
DeviceGroupKey : -lt0cpemm
Create new user
result=AuthSdk().createUser(user='nic5',phone='+66828773682',pw='12345678',name='nic3')
printDict(result)
success : True
user : nic5
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
villaAuthSdk-0.0.4.tar.gz
(9.6 kB
view hashes)
Built Distribution
Close
Hashes for villaAuthSdk-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78e1711279f94c39e38016a780745e2b77ea112442ca8caebc684ee69fb0cbfd |
|
MD5 | a19c30bc0a5dcb30916eb308f39deff6 |
|
BLAKE2b-256 | be656ac13d7f7e2dd80bd755ed52054d041269337720395032505686bb5e6de0 |