gasparyanyur's avatar

Laravel make auth in api

Hi all. I need to make a login functionality in my api , not registration.So I don't want to use Passport or something else. Please help me. How can I do this ?

0 likes
6 replies
tykus's avatar

I don't want to use Passport or something else

How do you intend to maintain a "session" in that case? Typically a token-based authentication would be used for an API. JWT-Auth is an alternative to Passort

gasparyanyur's avatar

You means, that I need to create api_token field in db .than render 60 length string for it?

tykus's avatar

Of course. The client must identify itself somehow - without a session cookie, a token is used instead.

gasparyanyur's avatar

I want to create api_token in my users table, and render a 60 length string for this, and every time send as a header the user api_token: what do you think about my version?

Please or to participate in this conversation.