Google Token
Python Package allowing Google Account Authorization Tokens to be issued when user is not in attendance.
Installation Instructions
pip install GoogleToken
Properties
When manually logging into a Google Account secured web application, the initial URL will be in the format;
https://accounts.google.com/o/oauth2/v2/auth?response_type=token&client_id=0000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com&redirect_uri=https://www.website.com/google/callback&scope=https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/userinfo.profile
Property |
Example |
|---|---|
Client Id |
0000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleuser content.com |
Redirect Uri |
|
Scope |
https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile |
Usage Instructions
First time login will create a Cookies file which stores the issued tokens which will subsequently be reused. It is recommended not to the password or the OTP secret in configuration. Once the cookies file is created the credentials are not required.
from GoogleToken import GoogleTokenGenerator, GoogleTokenParameters
parameters = GoogleTokenParameters(oauth_client_id="0000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com",
oauth_redirect_uri="https://www.website.com/google/callback",
oauth_scope="https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile",
account_email="user@gmail.com",
account_password="password",
account_otp_secret="secret")
generator = GoogleTokenGenerator(parameters)
token = generator.generate()
print(token)
Once the cookies file is created, the credentials can be omitted.
from GoogleToken import get_google_token
token, expiry = get_google_token(account_email="account@gmail.com",
account_password="password",
account_otp_secret="secret",
oauth_client_id="0000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com",
oauth_redirect_uri="https://www.website.com/google/callback",
oauth_scope="https://www.googleapis.com/auth/userinfo.profile")
Dependencies
Credits
Scott Philip
Berlin, Germany
Licence
GNU General Public License (Version 3, 29 June 2007)
CallerLookup Copyright © 2017 Scott Philip
Metadata
Release files for GoogleToken 0.7.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| GoogleToken-0.7.6.tar.gz | 22.4 kB | Without provenance | Details for GoogleToken-0.7.6.tar.gz |
Release files / GoogleToken-0.7.6.tar.gz
| Download URL | GoogleToken-0.7.6.tar.gz |
|---|---|
| Size | 22.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54154b3b0faf08d02f76e1f3c3a4edb746769e3a8c3adefd6b63ccf1fc95d6aa
|
|
BLAKE2b-256 checksum How to use checksums |
b439f0df9a76529f30ee09f5af66cdef6e41d6b517751558cc07e38e6595eb64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for GoogleToken 0.7.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.