Garpun Authentication Library
Project description
Garpun Auth Python Library
This library simplifies using Garpun’s various server-to-server authentication mechanisms to access Garpun APIs.
Google oauth2client library is taken as a basis.
Supported Python Versions
Python >= 3.4
Installing
You can install using pip:
$ pip install garpunauth
Using
# Use it for first auth with your scopes
GarpunCredentials.authenticate_user(['cloud-platform'])
# Get default credentials
credentials = GarpunCredentials.get_application_default()
print(u"credentials.access_token = %s" % str(credentials.access_token))
print(u"credentials.access_token_expired = %s" % str(credentials.access_token_expired))
print(u"credentials.refresh_token = %s" % str(credentials.refresh_token))
# Refresh access_token if it expired
import httplib2
http = credentials.authorize(httplib2.Http())
credentials.refresh(http)
print(u"credentials.access_token = %s" % str(credentials.access_token))
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
garpunauth-0.0.5.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for garpunauth-0.0.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28642e928104eb1a55e1c6e086a500bc0fa288414135be9f00255e50c56f1d13 |
|
MD5 | 4be95bd7b495bb2a0639f79129d287cd |
|
BLAKE2b-256 | 981d352f3cf48b174db44408b13fa3566482108a018c69daf8aa20d3c3c68b88 |