Library to authenticate with a LEAP platform
Project description
This library can be used to authenticate and manage passwords in a LEAP platform. It uses the Secure Remote Password protocol.
To install it:
$ pip install leap.auth
To use it:
from leap.auth import SRPAuth
api_uri = 'https://api.leap.platform:4430/'
ca_cert_path = './path_to_certificate.crt'
# TIP: the certificate is usually at https://api.leap.platform/ca.crt
user = 'username'
password = 'longandsecurepassword'
srp_auth = SRPAuth(api_uri, ca_cert_path)
# register a user
srp_auth.register(user, password)
# authenticate with the defined LEAP server using the registered credentials
auth = srp_auth.authenticate(user, password)
# then you can access:
auth.username
auth.session_id
auth.uuid
auth.token
# changes the authenticated user password using the authentication data
srp_auth.change_password(username, current_password, new_password, auth.token, auth.uuid)
# deletes the session on the server and resets the session locally
srp_auth.logout()
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
leap.auth-0.1.0.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for leap.auth-0.1.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 495ee5dc5e9f2856acb8ac2ee08d18cfe115976a89283aae3e578b89af7c4db7 |
|
MD5 | 0bd899c25bb6084b8551f48bc19d83b5 |
|
BLAKE2b-256 | b025d6a980c48e91bb62d444b839f05ee565d9b949a5fefdf206af2bdf7bba5f |