skyturk's avatar

Create api key per/person

Hi guys. I need api key. How can i generate api key each company. My application will show data according to company. How can i it.

0 likes
3 replies
topvillas's avatar

Use str_random(x) and save it in the companies table.

skyturk's avatar

Thanks topvillas but Doesn't api key store up my user identify?

topvillas's avatar

You're talking about JWT. That's a different thing that does indeed store the user's identity.

An API token just identifies who's making the request to the API.

If you want to use JWT then by far the most popular package is this ...

https://github.com/tymondesigns/jwt-auth

Please or to participate in this conversation.