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

vincentsanity's avatar

How do I use the API login and return Json without using Passport

I am making an mobile app and I want laravel to be my backend. Since it is not a big project. I wll not use laravel passport as an authentication for my api. I just want to login without authentication so that my api can be used freely in mobile. Is this possible?

0 likes
2 replies
bobbybouwmann's avatar

How can you login without authentication? I think you mean you want to login without a login form right?

Passport is the perfect library for that because, you login from your app once and you get an access token back. Then you're logged in by that token. So you send that token along on every request. This is what we call stateless authentication because there is no session, only a token.

1 like
vincentsanity's avatar

Nope, that was not I mean. I only want to login without obtaining a token or a bearer token using my login api route. And I want the api routes to be accesible to anyone

Please or to participate in this conversation.