Skip to content

Generating authentications

tlanclos edited this page Nov 17, 2015 · 3 revisions

Generate authentications for customers

Background

In order for the API to be of any use, there must exist authentications within the ticketapi.Authentication table. This table contains only a few columns at the time of writing this document. Those columns are companyID, hash, and salt--as well as the link to the techneaux company table. To fully populate these columns, three things must exist: a techneaux company name, a companyID for mapping (the username), and a password.

Using genauth

A tool was created to solve the problem mentioned above called genauth. This tool is located in the apps folder of the ticketapi package. In order to use this tool, you must be located at the parent directory to the root of the package and you must be logged in as the ticket-api user. The steps to get to this point are:

<ssh into techneaux ticket-api server>  # You cannot login as ticket-api directly, it has SSH prevention on passwords, login with a known username and the switch users to ticket-api. This is done to prevent brute force on the ticket-api user.
su ticket-api
cd /var/www/html

The next step is the launch genauth. This requires running it as Python module:

python3 -m ticketapi.apps.genauth

From this point, you can follow the instructions on the screen to enter the techneaux company name, then username (companyID), then password.

You may also choose to use the full CLI interface provided with genauth. At the time of writing this document, genauth has 3 parameters that it can take in '-c' (company name), '-u' (userame), and '-p' (password). It is not recommended to pass the password on the command line, but it is possible. You can also see a description of these options by running:

python3 -m ticketapi.apps.genauth -h

It is important to note that if you use the option above, you must surround the company name, username, and password in quotes if they contain spaces.

Clone this wiki locally