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 :)