Skip to content

Instantly share code, notes, and snippets.

@namsral
Last active December 29, 2015 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save namsral/7673054 to your computer and use it in GitHub Desktop.
Save namsral/7673054 to your computer and use it in GitHub Desktop.
Account Authentication Example
POST /api/authenticate
> Content-Type: application/x-www-form-urlencoded
>
user=lars,pass=secret
< 200 OK
<
{
"token": "897ca80f3443de1ad9c0ce8f9d7c4449c68606e0"
}
GET /api/whoami
> Authorization: 897ca80f3443de1ad9c0ce8f9d7c4449c68606e0
< 200 OK
< Content-Type: application/json; charset=utf-8
{
"user": ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment