validate

Available Since: V1

Validate a users login, this simply returns the information about the user the caller must compare the returned token with the previous token to ensure the user is still authenticated. 

Request

POST api/1/user/validate/
Parameter Description
uid The user ID to validate, this is the uid returned from the authenticate method.
data The payload data used in local authentication, normally part of the cookie data.
hash The hash being verified, calculated as hash_hmac('md5', data, authToken).

Successful Response (200)

{
	"uid": "1",
	"username": "theuser",
	"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.
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