Oauth2 token management for cli applications
Project description
Simple cli tools to create and use oauth2token
Configuration
You need to create config.json
and scopes.json
at
$XDG_CONFIG_HOME/oauth2token/<provider>/
for each provider you want
to use.
config.json
The main configuration file. Follow the format on client_secret.json, using your own information obtained from your provider.
Example (Just change the client_id
and client_secret
values to
the ones you got from Google):
{
"web": {
"client_id": "asdfjasdljfasdkjf",
"client_secret": "1912308409123890",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token"
}
}
scopes.json
The scope your application needs. It’s a json array containing the URLs.
Example :
["https://mail.google.com/"]
Usage
oauth2create
<provider> <account>
Obtain and store credentials for the account in
$XDG_DATA_HOME/oauth2token/<provider>/<account>
, using the configuration
for that provider. It opens a browser where you’ll need to log in the account
you want to use.
oauth2get
<provider> <account>
Output the access token for that account, refreshing it if needed with the associated refresh token.
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
File details
Details for the file oauth2token-0.0.3.tar.gz
.
File metadata
- Download URL: oauth2token-0.0.3.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df02473d83fbe2b4dda807d5299ecbaf3c0fe2d09e57e5516aca2ab35bb0fef8 |
|
MD5 | d0b75aad7b03eb62b6f773560836026f |
|
BLAKE2b-256 | aa665c74822fd0d4f56e8d4e0eaaaca24f6fd5eee8a738a50723715674aca3dd |