Implementing an RESTful API Authentication using tokens (Yii/Yii2)
I am building an API in Yii 1.x which will be used with a mobile application. Part of the process involves a login (with a username and password) using the following JSON request below:- // Request sent with username & password { "request" : { "model" : { "username" : "bobbysmith", "password" : "mystrongpassword" } } } // If successfully logged in return the following response { "response": { "code": 200, "message": "OK", "model": { "timestamp": 1408109484, "token": "633uq4t0qdtd1mdllnv2h1vs32" } } } This token is quite important - once a user is logged in on the app I'd like them to have