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

andrewhook's avatar

API authentication for organisations

I have an application whereby mulitple users can belong to an organisation/company and I need a method for authenticating the organisation when making requests to the API instead of users individually authenticating, similar to how Stripe uses a shared set of keys.

So far I have written a custom middleware which validates a token but I wondered if there was a better way?

0 likes
1 reply
topvillas's avatar
Level 46

Middleware is perfect for the scenario.

Please or to participate in this conversation.