So Im creating an API for an app that in the backend involves updating users, deleting users, and some other user related stuff.
Im using the slim framework and I was wondering when the user wants to update there details (Name, email, phone) should I make the API retrieve an auth token or the users password before the details are updated??
Example of my curl command ATM: So at the moment I am passing it the uID (prim key of user) which will be stored on the phone.
curl -i -X PUT -H 'Content-Type: application/json' -d '{"name": "Jimbo Change", "email": "jimbo@change.com.au","mobile":"0442889283","uID":"12"}' http://example.com/api/users/
Should I maybe replace the uID with an authentication token that is stored in the database or should I create an encrypted md5/sha of the email and then salt the password and mobile number into it?
Appreciate any feedback/advice!
Ps: Im just getting into security and am loving it so far :)
Also is it better to pass the "secret" key in the url of the api call or the body? I mean I don't think it would matter but what would you do?
– James111 Aug 27 '15 at 07:47