php - Securely storing user credential tokens -
i'm writing service users use oauth log service. point of service maintenance things user when they're not logged in. so, need keep oauth token stored can used while user not logged in. if user logged in, use user's password encryption key (asked each time; user's password stored hash) , store token encrypted.
but is, need web service able use tokens when user's not logged in. so, i'm considering storing them encrypted in database (aes), key decrypt them either need hard-coded application, or derived else (combination of user's name/email/hashed password), though logic of derivation still in source.
given written in php, cant compiled obscure secret key, best options making secure possible? source code has had database credentials in it, means mess database if @ source coe, having oauth tokens on hand means intruder mess user's data on other sites well, if mine compromised, , i'd give users assurance possible won't happen.
part of reason using oauth tokens in first place can revoked. protect tokens other user-specific data, , that's plenty. if have reason believe user data compromised @ specific point in future, inform users , ask them revoke token.
Comments
Post a Comment