Skip to main content

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


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)

Uploaded Source

Built Distribution

villaAuthSdk-0.0.6-py3-none-any.whl (8.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page