Repository navigation
0.7 Authentication
Authentication for UDJ is done using a ticket based system.
- The user provides the server with their Username and Password.
- If the Username and Password correspond to a valid user on the server, the server then issues a ticket.
- This ticket is then used in all further communication with the server.
Tickets are important and clients are strongly encourage to protect them as much as possible. A stolen ticket can result in a malicious entity impersonating a user.
The auth method allows a client to authenticate with the webserver and must be executed before any further communication between the client and the server can take place.
Required JSON object
{
`username` : username of user to be authenticated,
`password` : password of user to be authenticated
}
If the username and password combination is valid, the server will return a JSON object containing a ticket hash and the user's assigned id. The parameters should be given as a JSON object:
Example response from the server
{
"ticket_hash" : assigned ticket hash,
"user_id" : id
}
All subsequent requests must be sent with the given ticket in the header like so:
X-Udj-Ticket-Hash: assigned ticket hash
If any API methods that require authentication are called without this ticket in the header, or with an invalid ticket, a HTTP 401 response will be returned. The response'sWWW-Authenticate header will be set to the value ticket-hash.
Ticket's may become invalid at any time.
- HTTP 400 - Bad Request - The username and/or password attributes of the required JSON object was/were not supplied
- HTTP 401 - Unauthorized - The username and password combination is invalid. The
WWW-Authenticateheader will be set topassword.