Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

AuthenticationResource

Nick Douma edited this page Feb 13, 2012 · 1 revision

AuthenticationResource

PUT

Corresponds to login.

Request:

{
	"username": <username>,
	"password": <password>,
	"local_user": <username>
}

Response:

{
     "username": <string>,
     "valid_until": <int>,
     "hash": <string>,
     "token": <string>
}

Errors:

  • 500 - Invalid request or missing username/password.
  • 403 - Username/password incorrect.

POST

Corresponds to session validation.

If the session is valid, the duration is refreshed. If it is not, but it does exist, it will be destroyed.

Response:

true

Errors:

  • 500 - Missing or token with invalid format.
  • 403 - Invalid token.

DELETE

Corresponds to session logout.

Response:

true

Errors:

  • 500 - Missing or token with invalid format.
  • 500 - Could not destroy token.
  • 403 - Invalid token.
Clone this wiki locally