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
sdk=AuthSdk(user=None,pw=None,region='ap-southeast-1')
## user and pw here are the aws key/secret for your client
Create cashier
sdk.createCashier({
'user': 'nic1',
'phone': '+66816684442',
'pw': '12345678',
'name': 'nic',
'cashierId': '001'
})
{'success': True,
'user': 'nic1',
'phone': '+66816684442',
'pw': '12345678',
'name': 'nic',
'cashierId': '001'}
login
result = sdk.auth(user='nic1',pw='12345678')
printDict(result)
Confirm
confirm phone/email
result=sdk.confirm(user='nic1', code= '123')
printDict(result)
Get Profile
result=sdk.getProfile('nic1')
printDict(result)
update Profile
result = sdk.updateProfile(
user= 'nic1',
attributes= {
'custom:cashierCode': '1234'
})
printDict(result)
set password
sdk.setPassword(user='nic1',pw='12345678')
Unauth
get unauthenticated credentials
result = sdk.unauth()
printDict(result)
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.6.tar.gz
(10.2 kB
view hashes)
Built Distribution
Close
Hashes for villaAuthSdk-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13a3187169f78343b9c521ed264974fc27a19ae6aee2eb36304b097de1c3fe7b |
|
MD5 | 88c4bb1f365320c2d56ea6558341341b |
|
BLAKE2b-256 | ec7cd09369fc680bc3cb87b6bd3e4fb59592590651492ae107eee60a85a2dd8a |