eas2cli: Command line client for EAS
This package contains the command line client to make use of the EIDA Authentication System deployed at https://geofon.gfz.de/eas2 which will provide you with tokens to operate with most of the available EIDA web services.
Installation
You can install this page by mean of pip just executing
$ pip install eas2cli
Usage
Login
The first time you use eas2cli you will need to use the login command.
$ eas2cli login
Enter user code "4812-4844" at https://geofon.gfz.de/eas2/device
Time remaining to get a token [#-----------------------------------] 5% 00:04:45
Token saved in default location!
The system will give you a user code that you need to enter in the webpage
indicated in the same line. That page will redirect you to the B2ACCESS
system in the background. From there, you will be able to log in within your
institutional realm. As soon as your login is successful the application
will receive a token from EAS, which will be saved in the default location
(i.e. ~/.eidajwt).
Show your token
You can see the content of the token with the show command. This command
will always try to show a 'valid' token. This means that if the access token
is not valid anymore, then this will be refreshed in the background.
$ eas2cli show
access: {'sub': '519-XXXXXXXXXXX-3443', 'iss': 'https://geofon.gfz.de/eas2', 'aud': 'urn:fdsn:ws', 'iat': '2025-05-15T14:10:14', 'exp': '2025-05-15T15:16:54', 'email': 'username@datacenter.org'}
refresh: 5txjYYYYYYYYYYYYYJd4
scope: email profile USER_PROFILE eduperson_principal_name sys:scim:read_memberships openid eduperson_unique_id
id: {'iss': 'https://geofon.gfz.de/eas2', 'sub': '519-XXXXXXXXXXX-3443', 'aud': 'urn:geofon:eas', 'exp': '2025-05-15T15:10:13', 'iat': '2025-05-15T14:10:13'}
token_type: Bearer
expires_in: 4000
If you don't want your token to be refreshed, you can use the --no-refresh option.
Validation
The token will not be validated when you show it, but you can do it with
the --validate option.
$ eas2cli show --validate
access: {'sub': '519-XXXXXXXXXXX-3443', 'iss': 'https://geofon.gfz.de/eas2', 'aud': 'urn:fdsn:ws', 'iat': '2025-05-15T14:10:14', 'exp': '2025-05-15T15:16:54', 'email': 'javier@gfz.de'}
refresh: 5txjYYYYYYYYYYYYYJd4
scope: email profile USER_PROFILE eduperson_principal_name sys:scim:read_memberships openid eduperson_unique_id
id: {'iss': 'https://geofon.gfz.de/eas2', 'sub': '519-XXXXXXXXXXX-3443', 'aud': 'urn:geofon:eas', 'exp': '2025-05-15T15:10:13', 'iat': '2025-05-15T14:10:13'}
token_type: Bearer
expires_in: 4000
Explicit refresh
In the expires_in field you can see how many seconds the token will be valid.
The exact expiration time can be seen in the exp attribute of the access token.
After that moment you can get a new access token by means of the refresh command.
$ eas2cli refresh
If you show the new tokens you will see that the expiration time is later than the original one.
$ eas2cli show --validate
access: {'sub': '519-XXXXXXXXXXX-3443', 'iss': 'https://geofon.gfz.de/eas2', 'aud': 'urn:fdsn:ws', 'iat': '2025-05-15T14:11:01', 'exp': '2025-05-15T15:17:41', 'email': 'javier@gfz.de'}
refresh: 5txjYYYYYYYYYYYYYJd4
scope: openid email profile eduperson_unique_id eduperson_principal_name sys:scim:read_memberships USER_PROFILE
id: {'iss': 'https://geofon.gfz.de/eas2', 'sub': '519-XXXXXXXXXXX-3443', 'aud': 'urn:geofon:eas', 'exp': '2025-05-15T15:17:41', 'iat': '2025-05-15T14:11:01'}
token_type: Bearer
expires_in: 4000
Logout
If at any moment for any reason you would like to login again, just use
the logout command. All your local tokens will be removed.
$ eas2cli logout
If you do this you will need to manually login again to get an access token.
Do you really want to logout? [y/N]: y
You have been successfully logged out
$ eas2cli show
Error: There is a problem reading your available tokens. Try to log in again.
General help
You can have a list of available commands and options by executing
$ eas2cli --help
Usage: eas2cli [OPTIONS] COMMAND [ARGS]...
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
login Open a webpage to allow the user to login
logout Remove the file with tokens
refresh Refresh the access and id tokens stored locally
show Show the tokens stored locally
Integration with other programs
This package provides 2 ways of reading and using a valid token from
other programs. The first one is to use the python function gettoken().
By means of this, the caller will always receive a valid access token.
In the case that the token is expired, this is refreshed in the background
and after that it is returned (printed) to the caller.
>>> from eas2cli.core import gettoken
>>> print(gettoken())
eyJhbGci.....SldUIn0.eyJzdW.....6LmRlIn0.K7VAEN.....dbyUGQvc
Other option to show your access token is with the command show and the
option --no-decode to show it ready to be used.
$ eas2cli show access --no-decode
eyJhbGci.....SldUIn0.eyJzdW.....6LmRlIn0.K7VAEN.....dbyUGQvc
Metadata
Release files for eas2cli 0.2
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 |
|---|---|---|---|---|
| eas2cli-0.2.tar.gz | 19.4 kB | Without provenance | Details for eas2cli-0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eas2cli-0.2-py3-none-any.whl | Python 3 | none | any | Details for eas2cli-0.2-py3-none-any.whl |
Total release size: 39.4 kB
Release files / eas2cli-0.2.tar.gz
| Download URL | eas2cli-0.2.tar.gz |
|---|---|
| Size | 19.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6004d433f76bbeedfcc63361a6c9817f1f3136cd33f994e8f4500c71807b99f3
|
|
BLAKE2b-256 checksum How to use checksums |
448ee4c3bd7d1e3c4707091d8037e1b720f85d8df4d59cbc5bcec9c1bc289cba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.4
|
Release files / eas2cli-0.2-py3-none-any.whl
| Download URL | eas2cli-0.2-py3-none-any.whl |
|---|---|
| Size | 20.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e1fa30c9911510bbefd92fb3df69849aa32444e114d92b340a56e786e04eaa3
|
|
BLAKE2b-256 checksum How to use checksums |
9ccee0a71ec0407eb5432751ab52185ab5790f5619f85f2f83b2d361cd7a0b3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.4
|
Security for eas2cli 0.2
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.