Links API Authentication

Clients authenticate against the service by POSTing the username and password details as a Json string.

	{
		"username": "myuser",
		"password": "mypassword",
	}

If authentication is successful then a Json web token is returned.

	{
		"status": 200,
		"auth": true,
		"token": "reallylongtokenstring"
	}

The client should retain the token string and supply it via the X-Access-Token header on each subsequent HTTP method request. The token will expire according to the setting in the service configuration file.

If the client fails to authenticate then an appropriate response is returned to indicate the reason for the failure, e.g.

Token not provided:

	{
		"status": 401,
		"auth": false,
		"message": "No token provided."
	}

Token expired:

	{
		"status": 401,
		"auth": false,
		"message": "Token has expired."
	}

Token failed:

	{
		"status": 401,
		"auth": false,
		"message": "Failed to authenticate token."
	}