authenticate

Available Since: V1

Authenticate a user.

Request

POST api/1/user/authenticate/
Parameter Description
ip IP address of client.
username The username to authenticate if by is 'username'; else the email address.
password MD5 of password to authenticate with.
by 'username' to authenticate by username or 'email' to authenticate by email address.

Successful Response (200)

{
	"uid": "1",
	"username": "theuser",
	"displayname": "Display Name",
	"email": "user@example.com",
	"tz": "Australia/Perth",
	"token": "ffcc6bf60959c373589938cdc493de2b",
	"authState": 1,
	"roles": [
		"administrator"
	]
}
Parameter Description
uid The ID of the user within the system.
username The username of the user.
displayname The display name for the user.
email The users email address.
tz The users timezone.
token The authentication token which is used with the validate method.
authState The authentication state:
  • 0 - Unknown.
  • 1 - Ok.
  • 2 - Bad username or password.
  • 3 - Failed.
  • 4 - The client IP has been blocked for too many failed attempts.
  • 5 - User pending activation.
  • 6 - Disabled
  • 7 - Blocked
roles Array of roles assigned to the user.

Unsuccessful Response (400)

{
	"authState": 2
}
Parameter Description
authState The authentication state:
  • 0 - Unknown.
  • 1 - Ok.
  • 2 - Bad username or password.
  • 3 - Failed.
  • 4 - The client IP has been blocked for too many failed attempts.
  • 5 - User pending activation.
  • 6 - Disabled
  • 7 - Blocked



TOP