1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
Metadata-Version: 2.1
Name: oauth2token
Version: 0.0.3
Summary: Oauth2 token management for cli applications
Home-page: https://github.com/VannTen/oauth2token
Author: VannTen
Author-email: mg@max.gautier.name
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: POSIX :: Linux
Classifier: Intended Audience :: End Users/Desktop
Classifier: Development Status :: 2 - Pre-Alpha
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
###############
# Oauth2token #
###############
Simple cli tools to create and use oauth2token
Configuration
-----------------------
You need to create :code:`config.json` and :code:`scopes.json` at
:code:`$XDG_CONFIG_HOME/oauth2token/<provider>/` for each provider you want
to use.
:code:`config.json`
~~~~~~~~~~~~~~~~~~~~
The main configuration file.
Follow the format on client_secret.json_, using your own information obtained
from your provider.
.. _client_secret.json: https://github.com/googleapis/google-api-python-client/blob/master/docs/client-secrets.md
Example (Just change the :code:`client_id` and :code:`client_secret` values to
the ones you got from Google):
.. code-block:: json
{
"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"
}
}
:code:`scopes.json`
~~~~~~~~~~~~~~~~~~~~
The scope your application needs. It's a json array containing the URLs.
Example :
.. code-block:: json
["https://mail.google.com/"]
Usage
-----
:code:`oauth2create` <provider> <account>
Obtain and store credentials for the account in
:code:`$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.
:code:`oauth2get` <provider> <account>
Output the access token for that account, refreshing it if needed with the
associated refresh token.
|