I am developing a RESTful API and have considered using OAuth for password flow-like authentication. However, I've decided to implement my own authentication mechanism because I don't want the overhead of utilising OAuth in my project.
Everything is working well, but at the moment I'm not using any form of auth token encryption. What should I be using? Could you provide some articles which could point me in the right direction? The API will be used through HTTPS.
EDIT:
I'm using the following function to generate an access token:
public function generateToken($user)
{
return hash_hmac('sha256', Str::random(10), $user->id.time().uniqid(), false);
}
Is this secure enough?