Skip to content

Authentication API

Christopher Posada edited this page Apr 16, 2019 · 4 revisions

Endpoint

api/users/authenticate

Payload

{
  "Username": "jsnow",
  "Password": "Password#1"
}

Success Response

{
    "id": 5,
    "username": "jsnow2",
    "firstName": "John",
    "lastName": "Snow",
    "imageUrl": "/api/images/4/16/19/7dbaa88c-da3c-4e58-b8dd-7209645dbc70.png",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6IjUiLCJuYmYiOjE1NTU0NDQzNDAsImV4cCI6MTU1NjA0OTE0MCwiaWF0IjoxNTU1NDQ0MzQwfQ.nMjmhDBJ6ahQfcjmDKagKucS3w-ilert4C9lERll3mI"
}

Failure Response

Error 400

{
    "message": "Username or password is incorrect"
}

Notes

Pop the token you get back in the header for any actions that require auth ie:
Authorization | Bearer token.willbe.here

Clone this wiki locally