Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

donkfather's avatar

Api authorization

Hello,

I want to build an api and give the user a client_id and client_secret to access the api and retrieve some resources machine to machine. How is it done nowadays ? Would it be enough to generate a string and give that as the client_secret and his id as client_id or should I use passport client grant ? Using passport seams a little to much as he would have to get an access token and only then send the requests.

Thanks

0 likes
2 replies
Sergiu17's avatar

Hi, you could use Laravel Passport or JWT

donkfather's avatar

@SERGIU17 - that is what i was saying that passport would force the client to exchange those credentials to an access token. and i can't think how that would work. Would it mean that every time he tries to make a request he would have to get an access token ?

Please or to participate in this conversation.