Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 1.14 KB

File metadata and controls

49 lines (37 loc) · 1.14 KB

Login

Login with a registered profile in order to access further endpoints. The JWT token required to authenticate your requests will be included in a successful response's payload.

Note : Repeated requests to /authenticate will disable all previously valid tokens and leave the most recent one valid. In future versions of the API, users will not be able to attempt a log in if they have already done so. A mechanism to "ban" the user after 3 failed attempts will also be implemented.

  • URL /authenticate
  • Method : POST
  • Auth required : No
  • Request Structure
{
    "username" : "[valid username]",
    "password" : "[plaintext password]"
}

Success Response

  • Code : 200 OK

  • Response Structure

{
    "username" : "[valid username]",
    "token" : "[json web token]"
}

Error Responses

  • Cause : Provided username does not belong to a registered profile
  • Code : 401 Unauthorized
  • Response Message
"Username does not exist"
  • Cause : Username is valid, however the provided password is not
  • Code : 401 Unauthorized
  • Response Message :
"You provided an incorrect password"