Authenticate
Some of the operations within EOTDL require authentication.
CLI
You can authenticate in the CLI with the auth
command.
eotdl auth --help
Executing the login
command will return a URL that you can visit to authenticate. After authentication, your credentials will be stored locally. This enables future commands to be executed without having to authenticate again (at least while the credentials are valid).
eotdl auth login
You can logout by either deleting the credentials file or by executing the logout
command.
eotdl auth logout
You will receive a logout url that you can visit in case you want to authenticate with a different account.
In any case, you will be prompted to authenticate if you execute command that requires authentication and you are not logged in.
Alternatively, you can authenticate with an API key. To do so, set an environment variable with the key EOTDL_API_KEY
and the value of your API key.
At this moment we are not enabling all users to generate API keys. If you need one, please contact us.
Library
The CLI is built on top of the library, so again you will be prompted to authenticate if you execute a function that requires authentication and you are not logged in (or use an environment variable with your API Key).
API
The interactive documentation is available at https://api.eotdl.com/docs.
You can authenticate in the API using the login
endpoint.
curl -X 'GET' \
'https://api.eotdl.com/auth/login' \
-H 'accept: application/json'
You’ll reveice a URL that you can visit to authenticate and a code to retrieve your token. After authentication, you can retrieve your token with the token
endpoint.
curl -X 'GET' \
'https://api.eotdl.com/auth/token?code=your code here' \
-H 'accept: application/json'
You can now use the token to authenticate in any future request (at least while it is valid) adding a Bearer Token
header to your requests..
If you want to use a different account in the future, you will have to visit the logout url provided at the logout
endpoint.
curl -X 'GET' \
'https://api.eotdl.com/auth/logout' \
-H 'accept: application/json'
Alternatively, you can authenticate with an API key. To do so, use the header X-API-KEY
with the value of your API key.
User Interface
In order to authenticate through the user interface, you just have to click on the Sign In
button in the top right corner. You will be redirected to the authentication page. After authentication, you will be redirected back to the application.
To logout, you can click on the Sign Out
button that will appear instead.