-
Notifications
You must be signed in to change notification settings - Fork 0
Authentication
Authentication is the act of proving who you are.
In Money Toolkit this is simply giving us the correct user name and password.
Remember this is a read only API, so we dont feel our authentication has to ba any more complex than that.
An Authentication via the public api is simply a POST request much like from a web page's form.
Once successfully authenticated the json response will return a per session token (which will be set in the set-cookie header as well)
You need to keep this token and include it in subsequent request to the API.
passing a recognised username and password returns a message relating to the apropriate status code and a maximum of 30 minute token (or until memcache gets flushed)
https://www.moneytoolkit.com/pub/authenticate
POST
Content-Type: application/x-www-form-urlencoded
u=danm&p=pass
###Codes
- 200 - A successful authentication.
- 401 - Any failure, no password, wrong password etc returns Unauthorized
###Body A successful auth the body returns a token in json and the message WILL be 'authenticated'...
{"message": "authenticated", "token": "danmeWyPfuPj"}
Or in case of 401's some other message:
{"message": "authentication failed - no user"}