Jerakia uses tokens to authenticate access to the REST API for performing lookups using Jerakia Server. Before you can use the API you must first create a valid token for the application to use when making requests, the token must be sent in the
X-Authentication HTTP header of each request. Jerakia Server does not maintain a session.
Jerakia tokens are managed using the
jerakia token command.
To create a Jerakia token, issue the
jerakia token create command with an identifier for the intended application. Eg:
The output of the command will contain the token
The token is stored internally in a small database, but it is not retrievable. You should copy this authentication token and configure it in your application. If you lose an authentication token you must regenerate it with the
regenerate option. Eg:
This will delete the previous token and create a new one that must be copied.
If you need to automate this step, you can pass the
--quiet option to the
create subcommand, this will supress the explanatory output of the command and just output the token.
You can see a summary of what tokens are in use and their status using the
jerakia token list command. Eg:
You can disable a token by using the
jerakia token disable command. The token will continue to be stored in the database but access to the API will be denied using this token.
You can re-enable the token using the
You can completely remove a token using the
jerakia token delete command
Note that disabling, enabling or deleting tokens will not take effect until Jerakia Server refreshes it’s token cache, which by default happens every 300 seconds. See the
token_ttl setting in the server documentation.