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

BillRiess's avatar

Securely handling client_secret Passport

What is the best way to handle the client_secret in a first-party web or mobile application? Right now I have an API built in Laravel using Passport and a few first party consumers of this API. It is said to be insecure to leak or pass the client_secret in a web/mobile application but I don't know how you can request a password grant without passing the client_secret to /oauth/token. The only other way I can think of doing this would be to do a server-side curl request for the web (like a proxy) but this won't work in a mobile environment.

Is it safe to pass the client_secret to /oauth/client from a client-side call (via Axios)?

0 likes
1 reply

Please or to participate in this conversation.